View Full Version : Problem to automatically scrolldown with FireFox


Rodie
07-21-2005, 06:16 PM
Hi all :)

I have an HTML page that contains an <iframe>, called "oWhizzy". This iframe contains a <div> that contains a <table>. The point is that I fill the table rows after rows, and there is a vertical scrollbar that scrolls down automatically.

With Internet Explorer, the automatic scrolldown works, but not on FireFox. Why ?


What I attempt to do is write a javascript function in the <iframe>, to scrolldown the <div> when I load the iframe. But I cannot write javascript in the iframe like follow. I don't know why ...

In the main HTML page, I write the HTML code of the iframe like that:

var startHTML = "<html>\n";
startHTML += "<head>\n";
startHTML += "<script language=\"javascript\">" ---> does not work !!
...
startHTML += "</html>\n";

oWhizzy.document.open();
oWhizzy.document.write(startHTML);
oWhizzy.document.close();

Thanks if you have any idea, and if it is not too confusing ... :D

COBOLdinosaur
07-21-2005, 11:05 PM
startHTML += "<scr"+"ipt language=\"javascript\">"

and when you close the tag:

startHTML += "</scr"+"ipt>"

It does not let you do it if it sees the script tag because you are not supposed to write script inside a script.

Rodie
07-22-2005, 12:44 AM
Hi Dinosaur :)

Finally my <script> tag without having to do your trick. But I had to modify the </script> tag like this: but like this (with the backslash):
startHTML += "\</script\>";

Now my problem is that in the previous script, the following is a problem:
divo = window.frames["myIFrame"].document.getElementById("myDiv");
myIFrame: is an <iframe>
myDiv: is an <div> inside the iframe

Internet Explorer executes properly this line, not FireFox ... :angry:
Have you any idea ???

Anyway, thanks a lot for you help

COBOLdinosaur
07-22-2005, 03:32 AM
Try:
divo = top.frames["myIFrame"].document.getElementById("myDiv");

And if it does not work, look in the javascript console and see if Firefox is giving, you an error that might help tell us what it does not like.

Rodie
07-22-2005, 05:31 PM
Re hi Dinosaur :)

Actually, my <iframe> was not properly declared:
<iframe name='myiframe' id='myiframe'> --> works
<iframe id='myiframe'> --> DOES NOT WORK

You see how stupid it is !! :rolleyes:
So now I added the "name" and it works.

Anyway, thanks a lot to you :lolol: