[thelist] re: js url variables

Tom Dell'Aringa pixelmech at yahoo.com
Thu Mar 13 08:59:01 CST 2003

--- michael grover <mike at michaelgrover.com> wrote:

> I want to use Javascript to grab one particular variable out of a
> url sting containing many variables and I want to populate that
> variable into the text box of a form on the page.
> I have no control over the position of the variable nor of how many
> variables there are in the string.

This seems to get asked a lot. Anyway, courtesy of .jeff:


Watch the wrap. Read his explanation. This will allow you to grab any
name/value pair in the URL by simply doing:

url.foo or url["foo"] and get teh value. Then you can populate say a
text box like:

<input type="text" value="
" />



var me = tom.pixelmech.webDeveloper();

[Making A Commercial Case for Adopting Web Standards]

Do you Yahoo!?
Yahoo! Web Hosting - establish your business online

More information about the thelist mailing list