469,282 Members | 1,732 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

FireFox and iframe.src

JavaScripties:

On the HTML side, we load an IFRAME with a blank page:

<iframe frameborder="0" marginwidth="0" marginheight="0" scrolling="off"
src="about:blank" id="iframe_xml1!format_text"
name="iframe_xml1!format_text" width="90%" height=" 180 ">Your browser is
inferior and doesn't support IFRAMEs.</iframe>

Later, a button click populates this frame:

var iframe = window.frames[iframeName];
iframe.src = outputUrl;

That works on IE but not FireFox. Any tips?

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces
Jul 23 '05 #1
6 18345
Phlip wrote:
JavaScripties:

On the HTML side, we load an IFRAME with a blank page:

<iframe frameborder="0" marginwidth="0" marginheight="0"
scrolling="off" src="about:blank" id="iframe_xml1!format_text"
name="iframe_xml1!format_text" width="90%" height=" 180 ">Your
browser is inferior and doesn't support IFRAMEs.</iframe>

Later, a button click populates this frame:

var iframe = window.frames[iframeName];
iframe.src = outputUrl;

That works on IE but not FireFox. Any tips?


The object returned by references via the - frames - collection are
window/frame object, while the object representing the HTML IFRAME
element would be found in the DOM of the document in the window/frame
object containing the - frames - collection. The - src - property is
expected to be on the IFRAME element (though frequently read only) not
the window object within the IFRAME.

To navigate window/frame object the normal practice is to assign a URL
to the location property of the frame in question (or assign a URL to
the - href - property of the object already referred to by the location
property):-

iframe.location = outputUrl;

Richard.
Jul 23 '05 #2
Richard Cornford wrote:
To navigate window/frame object the normal practice is to assign a URL
to the location property of the frame in question (or assign a URL to
the - href - property of the object already referred to by the location
property):-

iframe.location = outputUrl;


Thanks!

Now, how do I also get it working with Opera?

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces
Jul 23 '05 #3
Phlip wrote:
Richard Cornford wrote:
To navigate window/frame object the normal practice is to assign a
URL to the location property of the frame in question (or assign a
URL to the - href - property of the object already referred to by
the location property):-

iframe.location = outputUrl;


Thanks!

Now, how do I also get it working with Opera?


It already does work with Opera, and Konqueror, Safari, IceBrowser, etc.
It is normal practice because it is the cross-browser method.

Richard.
Jul 23 '05 #4
Richard Cornford wrote:
iframe.location = outputUrl;


Thanks!

Now, how do I also get it working with Opera?


It already does work with Opera, and Konqueror, Safari, IceBrowser, etc.
It is normal practice because it is the cross-browser method.


The <iframe src="about:blank"> is inside a <span id="yo"
style="display:none">

Clicking a button switches the <span> to display:inline, and assigns the
iframe location.

What I thought was not "working" in Opera I now realize is a display bug.
Opera displayed the span and refreshed the iframe, but pushed them down off
the end of my window.

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces
Jul 23 '05 #5
Phlip wrote:
<iframe ... >Your browser is inferior and doesn't support IFRAMEs.</iframe>


Customer/Visitor: Your web site is inferior and has lost my business!

Please provide suitable alternate content so your site degrades
gracefully. A simple link to the iframe content would usually be suitable.
http://www.anybrowser.org/campaign/

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox
Jul 23 '05 #6
Lachlan Hunt wrote:
Phlip wrote:
<iframe ... >Your browser is inferior and doesn't support

IFRAMEs.</iframe>
Customer/Visitor: Your web site is inferior and has lost my business!

Please provide suitable alternate content so your site degrades
gracefully. A simple link to the iframe content would usually be suitable. http://www.anybrowser.org/campaign/ sigh<


I am aware this newsgroup educates HTML newbies.

My site is for in-house use /only/, and it has quite a few more technical
restrictions than just a W3C-compliant web browser:

http://www.c2.com/cgi/wiki?MiniRubyWiki

Kids - don't do that at home. Especially in text your boss might not notice
before your HTML goes online...

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces
Jul 23 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by wangzx | last post: by
3 posts views Thread by Alexander Higgins | last post: by
3 posts views Thread by CAG | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.