Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

IFRAMES and targets

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...
<head...
..../head>
<body>
<a href = 'somescript.php' target='content'>Something</a>
<iframe id='content' name='content' src='blank.php'></iframe>
</body>
</html>

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.

Thanks
CTB
0
chestertbear
Asked:
chestertbear
  • 2
1 Solution
 
redrider02Commented:
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?
0
 
chestertbearAuthor Commented:
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.
CTB
0
 
chestertbearAuthor Commented:
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.
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now