[thelist] JS: Token replacement

.jeff jeff at members.evolt.org
Wed Jan 22 13:39:01 CST 2003


joshua,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Joshua Olson
>
> > should it perform a location change to make the
> > necessary changes when you call the qs_replace()
> > function each time or should there be another
> > function that actually tells the system to take
> > all the changes made and perform a location change
> > with the new query string?
>
> All I'm looking for is the function that actually does
> the string modifications.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

well, in that case, use my url object and just do the replacing yourself.

http://members.evolt.org/jeff/code/js_url_variables/index.cfm

index.cfm?foo=bar&far=boo&cfid=1235908&cftoken=14598715

would result in the following:

url.foo = bar;
url.cfid = 1235908
url.cftoken = 14598715

once the object and its keys are created, you're free to change any of the
values as you see fit.  just make it a point to use the url object wherever
you're referencing query string values in your scripting.

however, keep in mind that if you make changes to key values and then parse
location.search again the changes won't be represented there.  the only way
to get them represented in location.search is to actually perform a location
change either after each individual change or triggered after you've
performed all the changes necessary.

does that help?

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/




More information about the thelist mailing list