467,905 Members | 1,887 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,905 developers. It's quick & easy.

How to reload a whole frameset with Opera

After my web page has been loaded I'm doing some tests with a JavaScript. If
I figure out that something is wrong I'd like to reload the whole frameset.

With Internet Explorer and Mozilla Firefox I can reload the whole frameset
with
parent.location.href = "index.html";

However, this doesn't work with Opera.
Does someone know how to do that with Opera?

Stefan
Nov 23 '05 #1
  • viewed: 6344
Share:
6 Replies

Try top.location.href or just window.location.reload();.

Danny
Nov 23 '05 #2
> Try top.location.href or just window.location.reload();.

Unfortunately it doesn't work.
top.location.href = "index.html"; works exactly same like
parent.location.href = "index.html";
That means, in Internet Explorer and Mozilla Firefox the frameset gets
reloaded and in Opera it doesn't work.
window.location.reload(true); reloads the current frame and not the whole
frameset.

Perhaps I have the ask my question a little bit more precise.
index.html has the frameset with two frames (frame1.html and frame2.html).
Within frame1 I'd like to reload the whole frameset (index.html) with a
JavaScript. With parent.location.href = "index.html"; or top.location.href
= "index.html"; it works fine with Internet Explorer and Mozilla Firefox but
not with Opera.

Stefan
Nov 23 '05 #3
> Try top.location.href or just window.location.reload();.

Unfortunately it doesn't work.
top.location.href = "index.html"; works exactly same like
parent.location.href = "index.html";
That means, in Internet Explorer and Mozilla Firefox the frameset gets
reloaded and in Opera it doesn't work.
window.location.reload(true); reloads the current frame and not the whole
frameset.

Perhaps I have to ask my question a little bit more precise.
index.html has the frameset with two frames (frame1.html and frame2.html).
Within frame1 I'd like to reload the whole frameset (index.html) with a
JavaScript.
With parent.location.href = "index.html"; or top.location.href =
"index.html"; it works fine with Internet Explorer and Mozilla Firefox but
not with Opera.

Stefan
Nov 23 '05 #4

Stefan Mueller wrote:

Perhaps I have to ask my question a little bit more precise.
index.html has the frameset with two frames (frame1.html and frame2.html).
Within frame1 I'd like to reload the whole frameset (index.html) with a
JavaScript.
With parent.location.href = "index.html"; or top.location.href =
"index.html"; it works fine with Internet Explorer and Mozilla Firefox but
not with Opera.


It works for me.

What is the Opera version and O.S.?
Do you get an error in the console?
What if anything does happen?
Can you display your code?
--
S.C.

Nov 23 '05 #5
>> With parent.location.href = "index.html"; or top.location.href =
"index.html"; it works fine with Internet Explorer and Mozilla Firefox
but
not with Opera.
It works for me.

What is the Opera version and O.S.?

The newest version (8.5 Build 7700) for Windows (Windows 2000).
Do you get an error in the console? No errors
What if anything does happen? Not the expected page (index.html) gets loaded. Opera reloads the actual
page again and again.
Can you display your code?

Of course.
Actually, while trying to reproduce my problem in a simple way I figured out
that my problem doesn't happen if I use the local files. It only happens if
the files are on a web server (and like mentioned only with Opera).

Please have a look:
http://web.seekware.ch/test/frame
If you press the Next button, frame 1b will be shown but because the input
box is '0' the frameset index.html gets reloaded (because of the
JavaScript). I know this doesn't make really sense. However, in my project I
use an input box in a second frame to verify if everything is fine or if the
frameset (index.html) has to be reloaded again.
If you press several times the Next button Opera doesn't reload the frameset
(index.html) but it does reload all the time frame 1b.
(PS:If you don't experience that problem try to change the value '0' to '1'
and press Next, do a reload on the browser, go back and forward with the
browser buttons, ...)

I guess it's something like a caching problem. However, it's really very bad
because with Opera my pages sometimes gets uninterruptable reloaded.

And here's the code:
--------------------------------------------------

index.html
=======
<html>
<frameset rows = "50%, 50%">
<frame src="frame1a.html" name="MyFrame1">
<frame src="frame2.html" name="MyFrame2">
</frameset>
</html>

--------------------------------------------------

frame1a.html
=========
<html>
<body>
Frame 1a
<input type = "button" value = "Next" onClick = "document.location.href
= 'frame1b.html'">
</body>
</html>

--------------------------------------------------

frame1b.html
=========
<html>
<head>
<script type = "text/javascript">
function FormLoaded() {
if (parent.MyFrame2.document.MyForm2.MyInput2.value == 0) {
parent.location.href = "index.html";
}
}
</script>
</head>

<body onLoad = "FormLoaded()">
Frame 1b
</body>
</html>

--------------------------------------------------

frame2.html
========
<html>
<body>
<form name = "MyForm2" action = "" method = "post">
<input type = "text" name = "MyInput2" value = "0"
</form>
</body>
</html>
Nov 23 '05 #6

Stefan Mueller wrote:

Please have a look:
http://web.seekware.ch/test/frame
If you press the Next button, frame 1b will be shown but because the input
box is '0' the frameset index.html gets reloaded (because of the
JavaScript). I know this doesn't make really sense. However, in my project I
use an input box in a second frame to verify if everything is fine or if the
frameset (index.html) has to be reloaded again.
If you press several times the Next button Opera doesn't reload the frameset
(index.html) but it does reload all the time frame 1b.
(PS:If you don't experience that problem try to change the value '0' to '1'
and press Next, do a reload on the browser, go back and forward with the
browser buttons, ...)

I guess it's something like a caching problem. However, it's really very bad
because with Opera my pages sometimes gets uninterruptable reloaded.

And here's the code:
--------------------------------------------------

index.html
=======
<html>
<frameset rows = "50%, 50%">
<frame src="frame1a.html" name="MyFrame1">
<frame src="frame2.html" name="MyFrame2">
</frameset>
</html>

--------------------------------------------------

frame1a.html
=========
<html>
<body>
Frame 1a
<input type = "button" value = "Next" onClick = "document.location.href
= 'frame1b.html'">
</body>
</html>

--------------------------------------------------

frame1b.html
=========
<html>
<head>
<script type = "text/javascript">
function FormLoaded() {
if (parent.MyFrame2.document.MyForm2.MyInput2.value == 0) {
parent.location.href = "index.html";
}
}
</script>
</head>

<body onLoad = "FormLoaded()">
Frame 1b
</body>
</html>

--------------------------------------------------

frame2.html
========
<html>
<body>
<form name = "MyForm2" action = "" method = "post">
<input type = "text" name = "MyInput2" value = "0"
</form>
</body>
</html>
More likely a timing problem I think. When you perform this test:
if (parent.MyFrame2.document.MyForm2.MyInput2.value = 0)


there's no certainty that the document in frame2 is loaded, and if not
it may be triggering a reload of the *currently specified pages*.
If the purpose of this test is to ensure that frame2 is loaded, there
are probably better ways like testing first for the existence of a
variable and then the value to which it is set on load.

--
S.C.

Nov 23 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Derek Ross | last post: by
3 posts views Thread by John Willingham | last post: by
1 post views Thread by Christopher Benson-Manica | last post: by
1 post views Thread by Deasun O'Donnachadha | last post: by
5 posts views Thread by David T. Ashley | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.