Javascript Return the url of the current page with no query string parameters
This Javascript function strips/removes any existing query string parameters from the url and returns the 'cleaned' url.
function stripParameters()
{
var loc = window.location.href;
return loc.split("?")[0];
}
Next: Javascript Add query string parameter dynamically to some or all links on the current page
Previous: Javascript Get all parameters and values as an Array
Javascript Query String Manipulation (TOC)
function stripParameters()
{
var loc = window.location.href;
return loc.split("?")[0];
}
Next: Javascript Add query string parameter dynamically to some or all links on the current page
Previous: Javascript Get all parameters and values as an Array
Javascript Query String Manipulation (TOC)
Comments
Post a Comment