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

How to "pause" while waiting for history.back

Status
Not open for further replies.

lobstah

Programmer
May 14, 2001
384
US
Hello,

Using the following script, in Netscape, the new window does not stay in focus, because the opener window takes too long to do it's history.back, so it brings the opener window back into focus and leaves the new window in back. In IE it works fine.

I tried using setInterval and setTimeout with no success, perhaps I had incorrect syntax.

Can anyone help with this? Want to have the new window display and stay in focus above opener window.

Thanks.


<script language=&quot;javascript&quot;>
<!--
var winURL = &quot;files/&quot; + '<%=sFileName%>';
var winName = &quot;newWind&quot; + Math.round(Math.random() * 9999999);
var winProp = &quot;height=500,width=725,top=20,left=20,scrollbars=yes,resizable=yes,menubar=no,toolbar=no,location=no,directories=no,status=no,copyhistory=no&quot;;
var newWin = window.open(winURL, winName, winProp);
newWin.opener.history.back();
newWin.focus();
//NN too slow on history.back and new window gets hidden
//-->
</script>
 
This has been resolved.
The problem was not with the history.back function, but rather with the page it went back to in history, which was a form that Netscape refreshes when it redisplays it and that is what was taking so long, not the actual history.back function.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top