Javascript Querystring Class - Danie Bruwer

Javascript Querystring Class

Published 06 August 08 01:45 PM | danieb

I have always found it difficult to manipulate querystring client side. So i searched for a javascript querystring helper class and found this class by Adam Vandenberg.

I added a couple methods that you may find usefull.

Here's a couple examples on how to use the enhanced class.

var qs = new Querystring();
qs.set("search", "changed");
alert(qs.get("search"));       
alert(qs.toString());
alert(qs.indexOfKey("search"));
alert(qs.toAbsoluteUrl());
alert("Removed search : " + qs.remove("search"));
alert("Removed search : " + qs.remove("search"));
qs.set("search", "search added with some empty spaces");
alert(qs.toAbsoluteUrl());

var qs2 = new Querystring("http://www.test.com?search=searchtext&page=1")
alert(qs2.toString());

Comments

# danieb said on August 27, 2008 11:45 AM:

See the latest version

dotnet.org.za/.../javascript-querystring-class-version-1-4.aspx

# Javascript Querystring Class Version 1.4 - Danie Bruwer said on August 30, 2008 02:31 PM:

Pingback from  Javascript Querystring Class Version 1.4 - Danie Bruwer

# rmlwpluabw said on November 15, 2008 03:41 AM:

4S0j8J  <a href="qazpfktjgaip.com/.../a>, [url=http://auenttkbktta.com/]auenttkbktta[/url], [link=http://hrfumbdqpcsx.com/]hrfumbdqpcsx[/link], http://pcpfzxhxprjs.com/

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: