...

View Full Version : query strings in javascript



cra992
06-02-2005, 07:18 PM
how do i retrieve parameters in html from a link such as: http://mysite.com/?param=1
does anyone know how to retrieve that information in javascript?

mark87
06-02-2005, 08:05 PM
You could try something like this -

function blah() {
linkquery=location.href.split("?");
query=linkquery[1]
}

Think that should work?

'query' is the text after the '?', so then you can do what you want with it...

cra992
06-02-2005, 08:33 PM
how would i display what is after the ?param=



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum