[thelist] Javascript Querystring?

.jeff jeff at members.evolt.org
Mon Nov 18 12:12:00 CST 2002


rick,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Rick [Kitty5]
>
> Is it possible to use some javascript to make all links
> on a page contain a querystring variable?
>
> eg get javascript to add '?foo=fee' to all links
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

yup, easy as pie.  check this out for an example of this:

http://members.evolt.org/jeff/code/ammend_links.cfm

all variations are accounted for:

1)  links that already have a query string attached, but
    with different name/value pairs
2)  offsite links that don't need to have the name/value
    pair attached.
3)  name/value pair with an unknown value.
4)  name/value pair that is one of several name/value
    pairs in the url (making it impossible to simply
    append location.search, but having to parse out the
    name/value pairs first)

enjoy,

.jeff

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




More information about the thelist mailing list