IFRAMES and targets

Posted on 2010-01-13
Medium Priority
Last Modified: 2012-05-08
Hi all,
I have an app that makes extensive use of iframes.  (Yes, I know, unfashionable... no lectures please.)  Essentially, it builds the top page with menu items on the left, and then loads the target of  those menu items into an iframe 'content' on the right.  The rationale is that as a visitor cycles through menu items, most of the page doesn't change, therefore, there's no point reloading it.

The top page will have html something like this...
<a href = 'somescript.php' target='content'>Something</a>
<iframe id='content' name='content' src='blank.php'></iframe>

This problem has me baffled...
It mostly works, but occasionally, and for no reason that I've been able to detect, you will click on a menu item, the target of which is definitely set to 'content', and the browser will open a new window (or tab).  It happens in IE, FF, Iron/Chrome and Safari.

I looked at the html doc type and changed it to
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

That helped, in that the wayward loading occurs less frequently, but it hasn't eliminated it altogether.  

I'm open to suggestion.

Question by:chestertbear
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

redrider02 earned 375 total points
ID: 26307070
After reading your question, I think I know what your trying to do.  Basically keep the menu or header of the site from reloading as a visitor clicks from the home page to the services page or contact page, etc?  

I see where the page you included was a php page, are you using all php pages?

Instead of using Iframes have you looked into using php includes?

For some of my sites I will design a header.php file with my main site header, a menu.php file with my navigational menu and a footer.php file.

Then as I build my other pages, says my news page, I just include those other pages by calling them with code like this

<?php include ("header.php"); ?>  

Wherever that is your header/menu/footer file will appear.

Maybe I am way off and this isn't much help?

Author Comment

ID: 26307192
Thanks redrider02.
That's a pretty good suggestion, from a coding perspective, but it doesn't eliminate the annoying blank-screen/wait page reload at the user's end.
I guess my problem now is that the iframe architecture is so embedded in the app (and it's a HUGE app) that to move away from it is a very big re-write that, commercially, I don't have time for.
However, I'm going to accept it as a slution because you've thought out of left field, and as it's clear that the iframe is fundamentally floored, yours is a valid suggestion.
Cheers, and thanks.

Author Closing Comment

ID: 31676568
While the solution doesn't directly address the problem, it does address the core probolem, which is that in hindsight, it ws a mistake to build this app with the iframe architecture, not because the intention wasn't good, but because iframes clearly have some 'undocumented' limitations.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question