Click to See Complete Forum and Search --> : JavaScript and Iframes


Orly2
04-04-2003, 06:40 AM
Hello, perhaps someone can help me with my situation. I have a product website. When you click on one of the links it opens in the iframe and the rest of the website remains the same. Simple. Now, when I load the webpage for the first time, the iframe displays an image. Ok, here's the problem. When you are on this site and you click on reload the page containing the iframe reloads but the iframe itself does not reload. I tried to remedy this by writting the following code:

<body onLoad="document.float.location.href='productos/main.html';">

where float = the name of the iframe and the main.html is the location of the image.

Now this solution works fine in Internet Explorer but not in Netscape and not in Mozilla. Can someone please help me?
Much appreciated, Orly

gil davis
04-04-2003, 07:42 AM
I think you'll find that in Netscape the iframe is part of the window.frames array, not part of the document.window.frames["float"].location.href="...";Fortunately (or not), this syntax works in IE as well.

Orly2
04-04-2003, 08:12 AM
Thank you very much, this solved my problem.

mrsocks
04-14-2003, 01:32 PM
i did a site for a customer and they wated to use iframes. now they are concerned that it doenst show in some browsers (as i explained) . i an seeing that there is a JavaScript answer to this. how would i implement them? (where would i look to learn how to do this, what term should i be looking for to do this?)

thanks