Forum Moderators: open
I've been trying to find a solution for this problem but I can't seem to get it.
Here is the problem:
I have a webpage that has an iframe with the id chat. Inside this iframe another page displays which has an iframe too with the id message_fr.
This last iframe message_fr refreshes itself each 20 seconds, displaying some text. My problem is that each time it refreshes it goes to the top of the document, but I want it to go to the bottom.
So I thought that maybe the solution was to add an "a name". So at the end of the document I added this line:
<a name="end"> </a>
And i created a short javascript in the body that takes the document to that place:
<SCRIPT LANGUAJE="JavaScript"> document.location = "#end";
</SCRIPT>
I thought it may work fine, but then I tested and I found out that the whole document moves...when I only want the document in the iframe message_fr to move.
I thought that maybe I should point out to the iframe object and I tried with different sintaxis:
document.chat.message_fr.location = "#end";
document.message_fr.location = "#end";
message_fr.location = "#end";
self.location = "#end";
But none of them work...with the first three I get the error "no object found"... and with the last one I get the same result (the whole document moves)...
I hope that I was able to explain my problem and it would be great if someone could help me out with this...
Thanks