JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 22nd, 2004, 05:22 AM
Comms Comms is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 2 Comms User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation window.opener.location.reload() error

hi,

i've been trying to get a pop up to refresh the window it came from (opener) and then close when it's finished.

I thought i had got it from looking around google, but everytime i try this script i get this error

Line: 7
Char: 3
Error: 'window.opener.location' is null or not an object


here are my pages.

parent.html
PHP Code:
<html>
<
head>
  <
title></title>
  <
base name="mainwindow">
<
script language="javascript">
function 
reloadIt() { 
  
window.opener.location.reload(); 
  
  return 
true;

function 
closeThis(){ 
  
window.close() 

function 
doIt() { 
  
reloadIt();
  
closeThis();

</script>
</head>
<body>
<A onClick="javascript:win1=open('one.htm','title1','width=200  ,height=200');">click</a>
</body>
</html> 


one.htm
PHP Code:
<html>
<
head>
  <
title></title>
</
head>
<
body>
<
form>
  <
input type="button" value="change2" onclick="opener.doIt();">
</
form>
</
body>
</
html


could someone please point me in the right direction.

i'm using ie6 for windows xp.

thanks, Comms

Reply With Quote
  #2  
Old July 22nd, 2004, 07:40 AM
BurhanKhan BurhanKhan is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 44 BurhanKhan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
Why not u use this function to refresh the page?

function refresh()
{
window.location = http://yourwebsite.com;
}


Burhan

Reply With Quote
  #3  
Old July 22nd, 2004, 08:09 AM
Comms Comms is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 2 Comms User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hi,

that works, thanks,
however my pop up window doesnt close, instead it closes the main window (parent.html)

Reply With Quote
  #4  
Old July 22nd, 2004, 08:41 AM
EiSa EiSa is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: Norway
Posts: 184 EiSa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 22 m 24 sec
Reputation Power: 16
Quote:
Originally Posted by Comms
hi,

that works, thanks,
however my pop up window doesnt close, instead it closes the main window (parent.html)

That's because you tell your main window (parent.htm) that it should be closed. If you wan't to close your pop-up you must put this script into that page, not parent.htm
__________________
Strictly CSS | Poker Cognac XO

Reply With Quote
  #5  
Old July 22nd, 2004, 09:56 AM
Pheifel Pheifel is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Denmark
Posts: 174 Pheifel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 46 sec
Reputation Power: 14
Send a message via MSN to Pheifel
in the childWindow. You should use the "parent.refresh(); self.close()" this should refresh, then close the window.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > window.opener.location.reload() error


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap