Why doesn't this work correctly in FireFox?

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

    Why doesn't this work correctly in FireFox?

    Hi all,

    I have created an ASPX page in VS 2008 that appears inside of an IFRAME
    inside a standard HTML page. Because it loads from an external site and is
    database driven, the first load takes a few seconds. As a result I have
    placed an absolutely positioned <DIVelement that is built into the HTML
    page that uses an animated GIF and a "Please Wait" message.

    When the IFRAME finishes loading a javascript function is called to change
    the Visibilty of the DIV to hidden. All this works fine with IE but in
    Firefox the DIV remains visible. Below is the relevant code from the HTML
    page.

    Can anyone tell me why this doesn't work in FireFox?

    -----------------------------------------------------------------
    <td width="775" valign="top">
    <iframe width="99%" style="z-index:1" height="820px" marginheight="4 px"
    marginwidth="4p x" id="ifSearch" scrolling="no"
    src="http://www.motillia.ne t/search.aspx" onload="iframe_ onload();">
    </iframe>
    </td>

    <script type="text/jscript" language="javas cript">
    function iframe_onload()
    {
    var theWaitCell = document.getEle mentById('Wait1 ');
    theWaitCell.sty le.visibility = "hidden";
    }
    </script>

    <div id="Wait1" style="visibili ty: visible; position: absolute; top: 40%;
    left: 40%">
    <table id="WaitTable1" >
    <tr>
    <td id="WaitCell1" align="center" valign="middle"
    style="backgrou nd-color: Silver;
    border-width: 4px; border-style: outset; color: White;
    height: 100px; width: 300px;
    font: vedana bold 16px">
    <img alt="downloadin g" src="images/loadingAnimatio n.gif" />
    <br />
    Search Tool Initializing...
    </td>
    </tr>
    </table>
    </div>
    --------------------------------------------------------------

    Thanks for any help with this.


  • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

    #2
    RE: Why doesn't this work correctly in FireFox?

    it works correctly in firefox, its IE thats wrong (good old buggy IE).
    setting visibility='hid den' mean do not display but take up space. you
    probably wanted to make the div disappear and not take up space try:

    theWaitCell.sty le.display = "none";


    -- bruce (sqlwork.com)


    "John Kotuby" wrote:
    Hi all,
    >
    I have created an ASPX page in VS 2008 that appears inside of an IFRAME
    inside a standard HTML page. Because it loads from an external site and is
    database driven, the first load takes a few seconds. As a result I have
    placed an absolutely positioned <DIVelement that is built into the HTML
    page that uses an animated GIF and a "Please Wait" message.
    >
    When the IFRAME finishes loading a javascript function is called to change
    the Visibilty of the DIV to hidden. All this works fine with IE but in
    Firefox the DIV remains visible. Below is the relevant code from the HTML
    page.
    >
    Can anyone tell me why this doesn't work in FireFox?
    >
    -----------------------------------------------------------------
    <td width="775" valign="top">
    <iframe width="99%" style="z-index:1" height="820px" marginheight="4 px"
    marginwidth="4p x" id="ifSearch" scrolling="no"
    src="http://www.motillia.ne t/search.aspx" onload="iframe_ onload();">
    </iframe>
    </td>
    >
    <script type="text/jscript" language="javas cript">
    function iframe_onload()
    {
    var theWaitCell = document.getEle mentById('Wait1 ');
    theWaitCell.sty le.visibility = "hidden";
    }
    </script>
    >
    <div id="Wait1" style="visibili ty: visible; position: absolute; top: 40%;
    left: 40%">
    <table id="WaitTable1" >
    <tr>
    <td id="WaitCell1" align="center" valign="middle"
    style="backgrou nd-color: Silver;
    border-width: 4px; border-style: outset; color: White;
    height: 100px; width: 300px;
    font: vedana bold 16px">
    <img alt="downloadin g" src="images/loadingAnimatio n.gif" />
    <br />
    Search Tool Initializing...
    </td>
    </tr>
    </table>
    </div>
    --------------------------------------------------------------
    >
    Thanks for any help with this.
    >
    >
    >

    Comment

    • Mark Rae [MVP]

      #3
      Re: Why doesn't this work correctly in FireFox?

      "John Kotuby" <jkotuby75@comc ast.netwrote in message
      news:eWxqgPlHJH A.1088@TK2MSFTN GP02.phx.gbl...
      Can anyone tell me why this doesn't work in FireFox?
      As Bruce has explained, FireFox is working correctly - it is IE which is out
      of kilter with the industry standards...

      If you are developing public websites and are interested in cross-browser
      compatibility, testing against IE (especially IE6) is one of the worst
      things you can do...


      --
      Mark Rae
      ASP.NET MVP


      Comment

      • John Kotuby

        #4
        Re: Why doesn't this work correctly in FireFox?

        Thanks bruce, I really thought what you suggested would do the trick. I was
        SO sure that I didn't try the "fix" until a few minutes ago.

        Now that I use... theWaitCell.sty le.display = "none";

        It still works in IE7 but not in FireFox 3. I added an alert(); to the
        function iframe_onload() and discovered that in FF the Alert box doesn't
        even display. It appears that FF3 is not respecting the
        onload="iframe_ onload();" but IE7 is.

        Everything I have read indicates that FF should have no problem with the
        IFrame onload event.

        This is becoming very perplexing for what should be a simple issue.

        Thanks for your help...but you (and Mark Rae) are correct in that IE is the
        ugly duckling of the lot of browsers and I will test in FF from now on.

        "bruce barker" <brucebarker@di scussions.micro soft.comwrote in message
        news:D0C0B57A-E5AA-498E-8282-2DFF04077FDA@mi crosoft.com...
        it works correctly in firefox, its IE thats wrong (good old buggy IE).
        setting visibility='hid den' mean do not display but take up space. you
        probably wanted to make the div disappear and not take up space try:
        >
        theWaitCell.sty le.display = "none";
        >
        >
        -- bruce (sqlwork.com)
        >
        >
        "John Kotuby" wrote:
        >
        >Hi all,
        >>
        >I have created an ASPX page in VS 2008 that appears inside of an IFRAME
        >inside a standard HTML page. Because it loads from an external site and
        >is
        >database driven, the first load takes a few seconds. As a result I have
        >placed an absolutely positioned <DIVelement that is built into the HTML
        >page that uses an animated GIF and a "Please Wait" message.
        >>
        >When the IFRAME finishes loading a javascript function is called to
        >change
        >the Visibilty of the DIV to hidden. All this works fine with IE but in
        >Firefox the DIV remains visible. Below is the relevant code from the HTML
        >page.
        >>
        >Can anyone tell me why this doesn't work in FireFox?
        >>
        >-----------------------------------------------------------------
        ><td width="775" valign="top">
        ><iframe width="99%" style="z-index:1" height="820px" marginheight="4 px"
        >marginwidth="4 px" id="ifSearch" scrolling="no"
        >src="http://www.motillia.ne t/search.aspx" onload="iframe_ onload();">
        > </iframe>
        ></td>
        >>
        ><script type="text/jscript" language="javas cript">
        >function iframe_onload()
        >{
        > var theWaitCell = document.getEle mentById('Wait1 ');
        > theWaitCell.sty le.visibility = "hidden";
        >}
        ></script>
        >>
        ><div id="Wait1" style="visibili ty: visible; position: absolute; top: 40%;
        >left: 40%">
        > <table id="WaitTable1" >
        > <tr>
        > <td id="WaitCell1" align="center" valign="middle"
        >style="backgro und-color: Silver;
        > border-width: 4px; border-style: outset; color: White;
        >height: 100px; width: 300px;
        > font: vedana bold 16px">
        > <img alt="downloadin g" src="images/loadingAnimatio n.gif"
        >/>
        > <br />
        > Search Tool Initializing...
        > </td>
        > </tr>
        > </table>
        ></div>
        >--------------------------------------------------------------
        >>
        >Thanks for any help with this.
        >>
        >>
        >>

        Comment

        • John Kotuby

          #5
          Re: Why doesn't this work correctly in FireFox?

          Thanks Mark,

          You are correct that FF is the better browser to test in as I have
          encountered alignment issues there that weren't apparent in IE and were
          indicative of poor coding such as failing to delcare align="center" in a
          table cell while expecting the contents to center themselves. Yeah, I use
          tables even though it's frowned upon in "modern" web design.

          Anyway, I have tried using... theWaitCell.sty le.display = "none" in the
          iframe onload event handler.
          It still works in IE7 but not in FireFox 3.

          I added an alert(); to the function iframe_onload() and discovered that in
          FF the Alert box doesn't
          even display. It appears that FF3 is not respecting the
          onload="iframe_ onload();" but IE7 is.

          Everything I have read indicates that FF should have no problem with the
          IFrame onload event.

          This is becoming very perplexing for what should be a simple issue.

          Any idea why the iframe onload event is not firing in FF?

          "Mark Rae [MVP]" <mark@markNOSPA Mrae.netwrote in message
          news:en2cfzlHJH A.4408@TK2MSFTN GP06.phx.gbl...
          "John Kotuby" <jkotuby75@comc ast.netwrote in message
          news:eWxqgPlHJH A.1088@TK2MSFTN GP02.phx.gbl...
          >
          >Can anyone tell me why this doesn't work in FireFox?
          >
          As Bruce has explained, FireFox is working correctly - it is IE which is
          out of kilter with the industry standards...
          >
          If you are developing public websites and are interested in cross-browser
          compatibility, testing against IE (especially IE6) is one of the worst
          things you can do...
          >
          >
          --
          Mark Rae
          ASP.NET MVP
          http://www.markrae.net

          Comment

          • Mark Rae [MVP]

            #6
            Re: Why doesn't this work correctly in FireFox?

            "John Kotuby" <jkotuby75@comc ast.netwrote in message
            news:uu9WJBqHJH A.3960@TK2MSFTN GP04.phx.gbl...

            [please don't top-post]
            >As Bruce has explained, FireFox is working correctly - it is IE which is
            >out of kilter with the industry standards...
            >
            Anyway, I have tried using... theWaitCell.sty le.display = "none" in the
            iframe onload event handler. It still works in IE7 but not in FireFox 3.
            Everything I have read indicates that FF should have no problem with the
            IFrame onload event.
            >
            This is becoming very perplexing for what should be a simple issue.
            >
            Any idea why the iframe onload event is not firing in FF?
            FireFox is "properly" standards-compliant - are you sure your markup and/or
            JavaScript is...?

            E.g. your <scripttag has a language attribute - that's been deprecated for
            years. Have you validated everything...?


            --
            Mark Rae
            ASP.NET MVP


            Comment

            • =?ISO-8859-1?Q?G=F6ran_Andersson?=

              #7
              Re: Why doesn't this work correctly in FireFox?

              John Kotuby wrote:
              Can anyone tell me why this doesn't work in FireFox?
              <script type="text/jscript" language="javas cript">
              JScript is the name of Microsoft's implementation of Javascript. I
              believe that Firefox is ignoring the script tag as the language is not
              recognised.

              Try:

              <script type="text/javascript">

              --
              Göran Andersson
              _____
              Göran Anderssons privata hemsida.

              Comment

              • John Kotuby

                #8
                Re: Why doesn't this work correctly in FireFox?

                "Göran Andersson" <guffa@guffa.co mwrote in message
                news:es4o5lqHJH A.468@TK2MSFTNG P06.phx.gbl...
                John Kotuby wrote:
                >Can anyone tell me why this doesn't work in FireFox?
                >
                ><script type="text/jscript" language="javas cript">
                >
                JScript is the name of Microsoft's implementation of Javascript. I believe
                that Firefox is ignoring the script tag as the language is not recognised.
                >
                Try:
                >
                <script type="text/javascript">
                >
                --
                Göran Andersson
                _____
                http://www.guffa.com
                Göran thank you,

                That was the problem. I was using proprietary Microsoft language. After
                changing the Script tag to read <script type="text/javascript" the event
                fires in both IE and FF.

                BTW... It appears that either syntax:
                theWaitCell.sty le.display = "none";
                or
                theWaitCell.sty le.visibility = "hidden";
                works properly in both browsers.

                I will be very careful from now on to use standards-compliant coding and
                test first in FF.

                Now I must comb through my other work and see if I have made the same
                mistake elsewhere. I think the jscript reference got pulled into my code by
                copying example code from VStudio or MSDN help examples.

                Thanks again Göran

                Comment

                Working...