Calling JavaScript from ASP

jamesviolet

New Member
I have a line of code: \[code\]Response.write("<script language=""text/JavaScript"">alert(""What up dog"");</script>")\[/code\]This doesn't work. I see no alert box, yet I see the page source has written the code correctly:\[code\]<script language="text/JavaScript">alert("What up dog");</script>\[/code\]What I'm actually trying to do is this: \[code\]Response.write("<script language=""text/JavaScript"">document.cookie = '" & Cookie & " = ; expires=Thu, 01 Jan 1970 00:00:01 GMT;';</script>")\[/code\]That is: Delete a cookie with the name stored in the ASP variable 'cookie'. This doesn't work either, which is why I'm attempting to create the alert box just to test where I'm screwing up.I've tried deleting the cookie with pure ASP (Response.cookie(Cookie).expires = Now() - 1), but since I made the cookie with JavaScript, it's not HTTPOnly so I can't access it with ASP. (I just learned this, so I'm not 100% on the why of it all, but there it is.)So, back to the first line of code, why am I not seeing a JavaScript alert box with that line of code? I'm obviously missing something simple (it's always something simple).
 
Back
Top