VBScript Equivalent to Request.Querystring 
Author Message
 VBScript Equivalent to Request.Querystring

Can VBScript achieve the same thing on the client as calling
Request.Querystring in ASP on the server?  In other words, I'd like to
replace the use of a server side Request.Querystring("ID") with a client
side VBScript that will read the ID= value off of the URL.

Can this be done?

Thank You.
LaDonna



Sat, 02 Sep 2000 03:00:00 GMT  
 VBScript Equivalent to Request.Querystring

Yes, You can do it using location.search
but, it isn't exactly like ASP, you have to extract the variable names
and values your self.
I would probably do it by using a bit of javascript like this - this
may look long winded, but if you are expecting more than one
parameter, it is much easier... :

// first get rid of the ? at the beginning
plen=window.location.search.length

// the following should be on one line.
parstring = new String(unescape(window.location.search.substring(1,
plen) ))

// Put all the parameters into an array
myparams = parstring.split("&")

// Now separate the name and values of parameters
for (element in myparams)
{
    thisparam = myparams[element].split("=");

// save this parameter value into the array to be accessed
// by parameter name.
    arrParams[ thisparam[0] ] = thisparam[1]

Quote:
}

// to access parameters now, all you need to do is this:
// arrParams["parametername"]
// and the number of parameters in your array:
// arrParams.length

I hope this helps.
-Heidi

Quote:

>Can VBScript achieve the same thing on the client as calling
>Request.Querystring in ASP on the server?  In other words, I'd like
to
>replace the use of a server side Request.Querystring("ID") with a
client
>side VBScript that will read the ID= value off of the URL.

>Can this be done?

>Thank You.
>LaDonna



Mon, 04 Sep 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Need more Request.QueryString and Request.Form help

2. Can I Request.form and Request.querystring?

3. Problems with listbox and asp and request.querystring.

4. Request.QueryString

5. request.querystring in JavaScript?

6. Request.QueryString

7. alternative to Request.QueryString

8. Request.QueryString in Jscript?

9. Merge, Request.QueryString

10. cannot get the Request.QueryString

11. Request.QueryString help

12. Request.Querystring/Form

 

 
Powered by phpBB® Forum Software