Need help with this ASP/Java script

Results 1 to 2 of 2

Thread: Need help with this ASP/Java script

  1. #1
    Join Date
    Dec 1969

    Default Need help with this ASP/Java script

    Simply put; Why doesn&#039t it work??<BR>I&#039m very new to ASP so please explain in detail how to make it work.<BR><BR>&#060;head&#062;<BR>&#060;%<BR>strRef erer = Request.ServerVariables("HTTP_REFERER")<BR><BR>if strReferer = "" then<BR> response.write "&#060;script language=&#039JavaScript&#039&#062;"<BR> response.write "var exit=true;"<BR> response.write "function jetsen()"<BR> response.write "{"<BR> response.write "if (exit)"<BR> response.write ",&#039jetsen&#039,&#039toolbar=ye s,location=no,directories=no,status=no,menubar=yes ,scrollbars=yes,resizable=yes,width=600,height=400 &#039);"<BR> response.write "}"<BR> response.write "&#060;/script&#062;"<BR>end if<BR>%&#062;<BR>&#060;/head&#062;<BR>&#060;body onunload="jetsen();"&#062;<BR><BR><BR>Thanks in advance from Tim

  2. #2
    Join Date
    Dec 1969

    Default RE: Need help with this ASP/Java script

    First are you sure you mean ASP/Java script? If your server side code is javascript be aware that there is no keyword "then" in javascript. That&#039s a VBScript keyword. What it looks like is you&#039re using server-side VBScript to write out client-side Javscript, in which case your sample code appears, on the surface, to be OK (I didn&#039t go through it with a fine-toothed comb so take that with a grain of salt.)<BR><BR>The HTTP_REFERER value will be the entire url the visitor came from inlcuding the http:// or https:// and will also have the filename on the end. Additionally, this environment variable will only hold a value if the user clicked a link from another page. It they manually type in the URL of your page OR they have the URL in their Bookmarks or Favorites list and they click on it there this variable will have an empty string in it. Just create a quick page with nothing but:<BR><BR>&#060;%<BR>Response.write Request.ServerVariables("HTTP_REFERER")<BR>%&#062; <BR><BR>in it and see how it looks when you hit the page. You&#039ll need to create another page with a link to this test page so the variable will have something in it.<BR><BR>Happy hunting.<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