FireFox and iframe.src

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Phlip

    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:blan k" id="iframe_xml1 !format_text"
    name="iframe_xm l1!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



  • Richard Cornford

    #2
    Re: FireFox and iframe.src

    Phlip wrote:[color=blue]
    > JavaScripties:
    >
    > On the HTML side, we load an IFRAME with a blank page:
    >
    > <iframe frameborder="0" marginwidth="0" marginheight="0 "
    > scrolling="off" src="about:blan k" id="iframe_xml1 !format_text"
    > name="iframe_xm l1!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?[/color]

    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.


    Comment

    • Phlip

      #3
      Re: FireFox and iframe.src

      Richard Cornford wrote:
      [color=blue]
      > 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;[/color]

      Thanks!

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

      --
      Phlip



      Comment

      • Richard Cornford

        #4
        Re: FireFox and iframe.src

        Phlip wrote:[color=blue]
        > Richard Cornford wrote:
        >[color=green]
        >> 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;[/color]
        >
        > Thanks!
        >
        > Now, how do I also get it working with Opera?[/color]

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

        Richard.


        Comment

        • Phlip

          #5
          Re: FireFox and iframe.src

          Richard Cornford wrote:
          [color=blue][color=green][color=darkred]
          > >> iframe.location = outputUrl;[/color]
          > >
          > > Thanks!
          > >
          > > Now, how do I also get it working with Opera?[/color]
          >
          > It already does work with Opera, and Konqueror, Safari, IceBrowser, etc.
          > It is normal practice because it is the cross-browser method.[/color]

          The <iframe src="about:blan k"> 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



          Comment

          • Lachlan Hunt

            #6
            Re: FireFox and iframe.src

            Phlip wrote:[color=blue]
            > <iframe ... >Your browser is inferior and doesn't support IFRAMEs.</iframe>[/color]

            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.


            --
            Lachlan Hunt

            http://GetFirefox.com/ Rediscover the Web
            http://GetThunderbird.com/ Reclaim your Inbox

            Comment

            • Phlip

              #7
              Re: FireFox and iframe.src

              Lachlan Hunt wrote:
              [color=blue]
              > Phlip wrote:[/color]
              [color=blue][color=green]
              > > <iframe ... >Your browser is inferior and doesn't support[/color][/color]
              IFRAMEs.</iframe>[color=blue]
              >
              > 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[/color]
              suitable.[color=blue]
              > http://www.anybrowser.org/campaign/[/color]
              [color=blue]
              >sigh<[/color]

              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:



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

              --
              Phlip



              Comment

              Working...