Javascript and an ASP Querystring - Help

Results 1 to 3 of 3

Thread: Javascript and an ASP Querystring - Help

  1. #1
    Elliot Guest

    Default Javascript and an ASP Querystring - Help

    I am attempting to build a Javascript utilizing values in an ASP querystring.<BR><BR>I want to build the Javascript based on the document.referrer property. It contains the querystring. The values in it are dynamic, however. So, I tried to assign the values of the query to an ASP variable assembled prior to the Javascript, with the arguments that I want in it(they are passed into the page anyway to do some ASP script), then assign it to the argument that document.referrer takes. <BR><BR>The Javascript does not print these values to the page. So I end up with no values at all. But, the rest of the string is printed to the page. So basically I end up with a query with no arguments.<BR><BR>How can I ensure that the arguments are printed?

  2. #2
    Join Date
    Dec 1969

    Default RE: Javascript and an ASP Querystring - Help

    your problem may be with "document.referrer". sometimes the value doesn&#039t show. but just to make sure, here&#039s a sample of moving asp values to javascript, then displaying them:<BR><BR>&#060;html&#062;<BR>&#060;body&#062;< BR><BR>&#060;%<BR>dim ASPvar<BR>ASPvar = "i love crap"<BR>%&#062;<BR><BR>&#060;script language="javascript"&#062;<BR> var JSvar = "&#060;%= ASPvar %&#062;"<BR> document.write (JSvar)<BR>&#060;/script&#062;<BR><BR><BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR>

  3. #3
    Join Date
    Dec 1969

    Default caveat

    JavaScript is a little more strictly typed than VBScript, so sometimes you need to perform string conversion on values such as Request.Form and Request.Querystring items<BR><BR>using <BR><BR>myVar = Request.Form("var").toString() <BR><BR>won&#039t work, you need to use<BR><BR>myVar = new String(Request.Form("var"))<BR><BR>jason<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts