By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,201 Members | 922 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,201 IT Pros & Developers. It's quick & easy.

FireFox and iframe.src

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.