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)

Comments

Popular posts from this blog

Php RSS2Writer (v2.1) - Generate RSS 2.0 Feed - Usage Instructions & Download

VBScript String Clean Functions -3 Methods to Remove or Replace Characters in a String

DIY SharePoint Marketing Tips & Tools - Do Follow SharePoint Article Libraries