I have a URL like http://localhost/dms/mduserSecurity/UIL/index.php?menu=true&submenu=true&pcode=1235.
http://localhost/dms/mduserSecurity/UIL/index.php?menu=true&submenu=true&pcode=1235
I want to get the URL without the query s
Try:
document.location.protocol + '//' + document.location.host + document.location.pathname;
(NB: .host rather than .hostname so that the port gets included too, if necessary)
.host
.hostname