Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

apostrophy delimnia

Status
Not open for further replies.

ebarratt

Programmer
Apr 10, 2002
53
0
0
US
Hey all,


I am using client side cookies to track if a user has been to my site before or not. In my html head section I call an asp.net subroutine shown below to decide whether my body tag has the onload method or not. If the user has a cookie then the body tag does not have an onload event and if the user does not have a cookie i have an onload event that calls a javascript function to pop-up my registration page also. The problem is that I can't seem to use the correct syntax in the Response.write method to write the javascript because of 2 apostrophie's needed in the syntax shown below. Could anyone show me the correct syntax so I don't recieve a javascript syntax error for first time users?

If IsNothing(Request.Cookies("cookieEmailAddress")) = True Then
Response.Write(&quot;<Body vLink='#0000c0' aLink='#0000c0' link='#0000c0' bgColor='#cccccc' onload='Javascript: window.open(' MS_POSITIONING='GridLayout'>&quot;)
Else
Response.Write(&quot;<Body vLink='#0000c0' aLink='#0000c0' link='#0000c0' bgColor='#cccccc'>&quot;)
End If

See the problem in the onload event with the 2 apostrophies?


Thanks all! Errol Barratt
work: 856-810-5712
home: 856-697-1593
*** If there is a possibility, I'm sure all the smart ones out there will enlighten me 8p
 
take out the javascript: and you can use the &quot;&quot; &quot;&quot; to create the &quot; &quot;
like this
Response.Write(&quot;<Body vLink='#0000c0' aLink='#0000c0' link='#0000c0' bgColor='#cccccc' onload=&quot;&quot; window.open(' MS_POSITIONING='GridLayout'>&quot;)
A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
alright I did that wrong.
here we go .. one more time ..

Response.Write(&quot;<Body vLink='#0000c0' aLink='#0000c0' link='#0000c0' bgColor='#cccccc' onload='window.open(&quot;&quot; MS_POSITIONING='GridLayout'>&quot;) A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
thank you for the help! Errol Barratt
work: 856-810-5712
home: 856-697-1593
*** If there is a possibility, I'm sure all the smart ones out there will enlighten me 8p
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top