Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-05-2006, 03:34 PM   PM User | #1
npala2001
New Coder

 
Join Date: Jul 2004
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
npala2001 is an unknown quantity at this point
A Popup and Redirect on One Page

Hey guys!

I am working on a page that will create a popup then send the parent page back to the previous page using the history.back function. I am using the history back function because our website uses session ids and there is no way to link to a specific page. The code below works in IE but not in FireFox and it takes a little longer then I would like.

Code:
<html>

<head>
<title>URL Redirect</title>
<meta http-equiv=refresh content=0;URL="javascript:history.back(-1);">
</head>

<script language="javascript">
function bustOut(){
   var newWin = window.open("http://LocationOfPopupPage", "subWindow","height=500,width=700,resizable=yes,scrollbars=yes");
}
window.onLoad = bustOut;
</script>

<body onLoad="bustOut()">
<p align="center"><br>
<font face="verdana, arial, helvetica"><span style="font-size:8.5pt;font-family:verdana, arial, helvetica">
<strong><br>
This The document is located on an internal site. The document will now be opened for you from the internal site</strong></span></font><p align="center"><font face="verdana, arial, helvetica"><p align="center"><font face="verdana, arial, helvetica"><span style="font-size:8.5pt;font-family:verdana, arial, helvetica"><strong>You will now be redirected back to the previous page</strong></span>
</body>
</html>
npala2001 is offline   Reply With Quote
Old 12-05-2006, 04:03 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,036
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Sorry - pressed wrong button
Philip M is offline   Reply With Quote
Old 12-05-2006, 04:04 PM   PM User | #3
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,036
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
window.onLoad =" bustOut()";
</script>

<body onLoad="bustOut()">

The second onload will overwrite the first.
Philip M is offline   Reply With Quote
Old 12-05-2006, 04:45 PM   PM User | #4
npala2001
New Coder

 
Join Date: Jul 2004
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
npala2001 is an unknown quantity at this point
Is there a way to get the redirect to take place while the user is viewing the popwindow. Whats happening now is the page opens in a pop which is great then once the user closes the pop page it takes it about 3 to 4 seconds for the parent page to change
npala2001 is offline   Reply With Quote
Old 12-05-2006, 05:14 PM   PM User | #5
npala2001
New Coder

 
Join Date: Jul 2004
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
npala2001 is an unknown quantity at this point
I know I could something like this if I had access to the popup source files

Code:
<script language="Javascript" type="text/javascript">
changeParent(){
parent.window.location="javascript:history.back(-1);";
}
</script>
Code:
<body onUnload="changeParent()">
since I dont have access to the source files that the page is calling I was hoping there was a way to start a process on the parent page so that while the user is viewing the popup window its changing the page so that when they closed the pop they were at the correct page already
npala2001 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:12 AM.


Advertisement
Log in to turn off these ads.