FireFox and iframe.src

P

Phlip

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?
 
R

Richard Cornford

Phlip said:
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.
 
P

Phlip

Richard said:
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?
 
R

Richard Cornford

Phlip said:
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.
 
P

Phlip

Richard said:
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.
 
L

Lachlan Hunt

Phlip said:
<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/
 
P

Phlip

Lachlan said:
Phlip wrote:
IFRAMEs. said:
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.

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,158
Latest member
Vinay_Kumar Nevatia
Top