| Welcome to WebmasterWorld Guest from 220.127.116.11 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|Linking to a named anchor inside an iframe|
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>
document.location = "#end";
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...
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved