When a user login to my site, it redirect them to the member-page, I also want it to open a new window. How do I insert the code into the login-page ?
I tried putting the following code before the redirect code, but it doesn't execute, perhaps because it's above the <html> tag. But It does redirect to abc.asp !
--------------------- <% if (a=b) then %> <script language="javascript"> window.open('im/messenger.asp'); </script> <% response.redirect "abc.asp" end if %> ----------------------
Another option I also tried is putting this code into the member-page. And I had to include a counter like "winopen = 1" to open only once, I dont' want it opening everytime the page is refreshed.
But it doesn't seem to work when ppl press the 'back' button to the member-page. It seems it runs the old generated code, opens the window again, without the checking with the server of "winopen = 1".
You can not put the code before the redirect because it would never be run. The JS code would be run on the clients computer, but in the ASP code if you redirect then the server redirects and never sends the html which would have the JS code in it.
What you would have to do is run the JS script and then have the html code redirect after 1 second to abc.asp