February 21st, 2008, 12:53 AM
#1
parent.location.reload() not working in FireFox
Help me please....
myFile.js
Code:
window.onbeforeunload=init;
function init()
{ parent.location.reload(); }
Above code is working fine on F5 in IE to refresh the IFrame with it's Container Page but failed for FireFox
Last edited by PeejAvery; February 21st, 2008 at 09:23 AM .
Reason: Added code tags.
February 21st, 2008, 09:22 AM
#2
Re: parent.location.reload() not working in FireFox
If this is a popup, use opener instead of parent .
EDIT:
Originally Posted by
AbrarNazeer
refresh the IFrame with it's Container Page
Are you trying to refresh the parent of an iframe or refresh the iframe itself?
Last edited by PeejAvery; February 21st, 2008 at 09:26 AM .
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
February 26th, 2008, 02:41 AM
#3
Re: parent.location.reload() not working in FireFox
PeejAvery! Thanks for ur time ...
1) this is NOT a popup
2) I'm trying to refresh the parent of an iframe NOT iframe itself.
Background - Banner Images Pairs :
Actually , Iframe displays the Banner Image while Iframe Container Page display the Background Image. on F5 , this pair of images refresh perfectly in IE while in FireFox , Background Image become cached and IFrame refreshed , so the Pair of images become unmatched.
February 26th, 2008, 10:04 AM
#4
Re: parent.location.reload() not working in FireFox
Are you sure it is a cache issue? If so, you can use <meta> tags to override the cache.
Code:
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="Sat, 1 Jan 2000 00:00:00 GMT">
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
February 27th, 2008, 12:32 AM
#5
Re: parent.location.reload() not working in FireFox
PeejAvery!
"<meta> tags" did not solve my problem. Means that "this is not a cache issue". But I'm stuck here to solve the issue on FireFox.
February 27th, 2008, 08:06 AM
#6
Re: parent.location.reload() not working in FireFox
Well, the onbeforeunload event doesn't work in Firefox or Safari. At least not in my testing. The following worked perfectly fine though.
Code:
function init() {
parent.location.reload();
}
window.onunload = init;
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
March 16th, 2008, 11:42 PM
#7
Re: parent.location.reload() not working in FireFox
PeejAvery!
Code:
function init() {
parent.location.reload();
}
window.onunload = init;
did not work fine on FireFox(2.0.0.12).
Last edited by PeejAvery; March 17th, 2008 at 07:43 AM .
Reason: Added code tags.
March 17th, 2008, 08:51 AM
#8
Re: parent.location.reload() not working in FireFox
Well then there is something else you are doing that is blocking it. The attachment works perfectly.
Attached Files
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
March 18th, 2008, 02:50 AM
#9
Re: parent.location.reload() not working in FireFox
PeejAvery! The code u ve sent is working fine (Thanks) . but fruitless for me.
Here is the short description of my requirement and issue...
JS file -----------------> Web Page #01
|
-----------------> Web Page #02
JS file displays the Banner and Background combination by the help of these 2 web pages. Code details are
1) Web Page #01 displays Banner in iframe,iframe attributes are set by JS File
var url = 'http://www.myWebSerer.com/WebPage01.aspx'
var oIfrm=document.createElement("IFRAME");
oIfrm.setAttribute('id','iframe1');
oIfrm.setAttribute('src',url);
2) Web Page #02 sets the background
document.body.background = 'http://www.myWebSerer.com/WebPage02.aspx';
the concerned thread's URL is
"http://forums.mozillazine.org/viewtopic.php?t=630475&highlight="
please visit for me.
March 18th, 2008, 07:10 AM
#10
Re: parent.location.reload() not working in FireFox
I'm not going to join another forum for every person who comes on here and asks for help in multiple forums. That is a complete waste of my time.
If you are going to change the style of the background through CSS, you must use valid CSS.
Code:
document.body.background = 'url(http://www.myWebSerer.com/WebPage02.aspx)';
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width