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
Use properties of window.location
window.location
var loc = window.location; var withoutQuery = loc.hostname + loc.pathname; var includingProtocol = loc.protocol + "//" + loc.hostname + loc.pathname;
You can see more properties at https://developer.mozilla.org/en/DOM/window.location