Welcome to WebmasterWorld Guest from 54.227.48.147

Forum Moderators: keyplyr & mack

Message Too Old, No Replies

iframe and pagination - Need Help

iframe, javascript

     
9:30 pm on Jun 19, 2003 (gmt 0)

New User

10+ Year Member

joined:June 19, 2003
posts:5
votes: 0


Hi!
I have an HTML page, with the iframe in it. The iframe is supposed to change its source as user clicks on the pagination as follows:

previous 1¦2¦3¦4¦5 next

the source for the iframe should change accordingly from go_page1.htm to go_page2.htm to go_page3.htm, etc. to avoid the reloading of the whole HTML page.

Need help for the pagination javascript code. THANKS!

Alla

9:57 pm on June 19, 2003 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member pageoneresults is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 27, 2001
posts:12172
votes: 61


Hello Alla, Welcome to WebmasterWorld!

Your links need a target. So, if we are discussing link #1, it might look like this...

<a href="link.htm" target="i1">

That target="i1" is what will bring the targeted page into the iframe. Your iframe also needs to be named so that the target works...

<iframe name="i1">

Note how the target="i1" matches the <iframe> name="i1". All of your links for that one <iframe> will have the same target.

Now, if you had two <iframe>s on the page, then one might be named "i1" and the other "i2". Depending on which <iframe> was to display which linked content, will determine how you target your links.

P.S. No javascript required!

10:42 pm on June 19, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


I like the idea of using iframes for longer articles like this. For some reason I never thought of it before. As long as I take care of the search engine spiders by having a straight text link to each page somewhere else, it should make for a very comfortable experience for the user.

Thanks for bringing up the idea.

10:51 pm on June 19, 2003 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member pageoneresults is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 27, 2001
posts:12172
votes: 61


As long as I take care of the search engine spiders by having a straight text link to each page somewhere else, it should make for a very comfortable experience for the user.

<iframe>
<h1>Heading</h1>
<ol>
<li>link</li>
<li>link</li>
</ol>
</iframe>

That ordered list will present itself if the users browser does not support <iframe>s.

10:54 pm on June 19, 2003 (gmt 0)

New User

10+ Year Member

joined:June 19, 2003
posts:5
votes: 0


This is great. It worked. Thanks a lot!