...

View Full Version : iframe help



lawler_09
02-22-2011, 08:23 PM
hi guys.

im currently doing a college project and need some help!! so any help would be much appreciated!

basically i have a set of styled links like below:



<div id="accountnav">
<ul id="accountnavlist">
<li><a href="1.php">Link 1</a></li>
<li><a href="2.php">Link 2</a></li>
<li><a href="3.php">Link 3</a></li>
<li><a href="4.php">Link 4</a></li>
</ul>
</div>


and when i click on one of them links, i want the page to open up in the iframe thats on the same page.

i've done something similar using php before, but that was taking selections from a form, but this is taking it just from a link.

again any help would be much appreictaed!!

thanks!

Keleth
02-22-2011, 08:27 PM
This has nothing to do with PHP... you give your iframe a name, then you use the a tags's target attribute.

So if the iframe has a name "testFrame", you give the link target="testFrame".

But honestly, iframes are both out of fashion, as well as a general pain, for you as a programmer, and for people visiting the site. Regardless, that's how its done.

lawler_09
02-22-2011, 08:29 PM
This has nothing to do with PHP... you give your iframe a name, then you use the a tags's target attribute.

So if the iframe has a name "testFrame", you give the link target="testFrame".

But honestly, iframes are both out of fashion, as well as a general pain, for you as a programmer, and for people visiting the site. Regardless, that's how its done.

thanks a lot for that, i realised just after id posted, *durrrrrrr*!!

whats the better way to go about this now? for future reference!

again much appreciated!

Keleth
02-22-2011, 08:59 PM
Having separate pages. The idea of iframes I think caught on because it looked like the same page, seemed like less load time... but it makes navigating (going back/forward) harder, it makes bookmarking impossible, and iframes act up in different browsers. Think about why you think you need an iframe, then consider, why bother? An iframe makes it appear as if you're on the same page, but has a load time... you could instead have your header/footer in their own files then include on each page. Thus, you get the exact same look on every page, with the same (well, ever so slightly slower) load time, but people can no navigate easily, they can bookmark pages they like, share specific content, etc.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum