View Full Version : Iframe in Firefox
Burgin
11-11-2009, 01:44 PM
Two questions... I'm playing around with using iframes on a page and when testing on my local server (not uploaded yet, so no link) they appear OK in IE8 IE7 & Chrome but not in Firefox, why is that?
And reading some of the other threads, it's mentioned that iframes cannot display pages from other sites yet mine appear to be able to. Why?
here's my code...
<iframe id="bbc" scrolling="no" marginwidth="0" frameborder="0" marginheight="0" src="http://www.bbc.co.uk/news/" width="780" height="400"></iframe>
jscheuer1
11-11-2009, 03:26 PM
I copied your iframe code to a page and viewed it in Firefox. Worked fine here. Perhaps you have iframe support turned off in your copy of Firefox. I'm pretty sure this can be done, but also sure that if it can, it is not a simple configuration toggle. It is also possible that code around the iframe or elsewhere on your test page is poorly enough written that Firefox just doesn't 'see' the iframe, while other browsers mange to error correct for your code.
To answer your other question, there is no issue with showing other sites in an iframe per se. You cannot cross script between the top page on one domain and a page in an iframe on another domain though (at least not without certs). Also if the page from another site you wish to place in your iframe has code on it to 'break out of frames', there is nothing you can do to stop it. Well, of course, if it is javascript code, you can turn off your local javascript, but this will have no effect on others viewing your page. And, though I'm not certain, I believe there may aslo be server side methods for 'breaking out of frames'. If so, there is nothing that can be done about that. One may always (if legal) copy the other page's content and make one's own page for it, then you can do whatever you like with your copy if it is hosted on your domain.
In any case, iframes are being deprecated - which means that support is not standardized, and could (probably will) be completely absent in some future versions of browsers, though that time is not likely to be very soon.
Burgin
11-11-2009, 04:15 PM
Thanks jscheuer1
Your answer to my 2nd question was most informative.
I'm still confused with my first issue. On my page I have 7 different iframes, some external pages some internal pages, all differing sizes and Firefox displays them all but not in the correct iframe.
jscheuer1
11-11-2009, 04:29 PM
I misunderstood then. When you said:
they appear OK in IE8 IE7 & Chrome but not in Firefox
I took that to mean that they didn't show up at all in Firefox. If they are showing up, but with the 'wrong pages', there may be something in your layout (the flow of the page) that reorganizes where each iframe appears. In other words, the pages are in the right iframes, its just that the iframes are not being displayed in the order you anticipate.
Or, if you are merely refreshing the page in Firefox, as opposed to navigating to it anew each time, changes to the src attribute of iframes may not take affect. Firefox will remember what was loaded into each iframe, and upon refresh, may recall this rather than use a new or existing src attribute.
To be of any real help here though, I would need to see the page in action.
If as you say, it isn't live yet - you could always upload a demo somewhere and post a link to it here so I can check it out.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.