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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening Web Page Problem 1

Status
Not open for further replies.

FontanaS

Programmer
May 1, 2001
357
US
I have the following code -

<!--NOW OPEN UP THE PDF FILE WEB PAGE AUTOMATICALLY-->
<script type="text/Javascript">
window.open(" null);
</script>

<!--REDIRECT THE USER TO THE MAIN MENU-->
<%response.redirect("MainMenu.asp")%>

The problem is that the javascript does not work when i have the response.redirect available. IF I comment out the response redirect, the javascript works and a new web opens automatically, If I don't comment out the response redirect, no new web page opens at all.
 
that's because your response.redirect happens before the page is rendered (on the server side) while javascript occurs on the client side.

you can try something like this:

Code:
<script type="text/javascript">
// open window
window.open("[URL unfurl="true"]http://172.26.104.141/CreditCard/PdfOrdersNew.Asp",[/URL] 'w', '');

// redirect user
window.location = "[URL unfurl="true"]http://172.26.104.141/CreditCard/MainMenu.asp";[/URL]
</script>



*cLFlaVA
----------------------------
[tt]somebody set up us the bomb![bomb][/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top