Firefox 3 problem with Sys.Application.add_load

Last post 07-01-2008 7:31 AM by Blarm1959. 4 replies.

Sort Posts:

  • Firefox 3 problem with Sys.Application.add_load

    06-27-2008, 4:38 AM
    • Member
      point Member
    • Blarm1959
    • Member since 06-26-2008, 8:27 PM
    • Posts 3

    In the following aspx page, although the ffalert is always displayed, the ff1 alert is only displayed intermitently on a page refresh (about 7 out of 10 times).

    This works fine with FF2 and IE.

    FF3.aspx:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="hd" runat="server">
    <title>FF3 Test</title>
    </head>
    <body>
      <form id="frm" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
    FF3 Test
      <script type="text/javascript">
        function page_load() {
            alert("ff31");
       }
        window.onload = function () {Sys.Application.add_load(page_load); alert("ff30");}
      </script>
      </form>
    </body>
    </html>
    
     
  • Re: Firefox 3 problem with Sys.Application.add_load

    06-27-2008, 9:55 AM
    Answer
    • Star
      13,403 point Star
    • gt1329a
    • Member since 06-24-2002, 12:53 AM
    • Atlanta
    • Posts 2,212
    • ASPInsiders
      TrustedFriends-MVPs
    You can use the pageLoad() shortcut function instead.
    Encosia - ASP.NET, jQuery, AJAX, and more.

    Latest article: Using jQuery validation with ASP.NET WebForms
  • Re: Firefox 3 problem with Sys.Application.add_load

    06-30-2008, 5:46 AM
    • Member
      point Member
    • Blarm1959
    • Member since 06-26-2008, 8:27 PM
    • Posts 3

    Thanks for that.

     I am using jquery, but didn't want to cloud the issue by including that in my example.

    I usually have, e.g.

        $(document).ready(function() {
            Sys.Application.add_load(page_load);
        });
       
        function page_load() {
       
            $("#Tabs > ul").tabs();
        }

     to ensure that the code gets run for partial postbacks from an updatepanel.

    If I rename page_load to pageLoad can I just remove this code

        $(document).ready(function() {
            Sys.Application.add_load(page_load);
        });

    Thanks

     
  • Re: Firefox 3 problem with Sys.Application.add_load

    06-30-2008, 8:20 AM
    • Star
      13,403 point Star
    • gt1329a
    • Member since 06-24-2002, 12:53 AM
    • Atlanta
    • Posts 2,212
    • ASPInsiders
      TrustedFriends-MVPs
    That's correct.
    Encosia - ASP.NET, jQuery, AJAX, and more.

    Latest article: Using jQuery validation with ASP.NET WebForms
  • Re: Firefox 3 problem with Sys.Application.add_load

    07-01-2008, 7:31 AM
    • Member
      point Member
    • Blarm1959
    • Member since 06-26-2008, 8:27 PM
    • Posts 3

    Thankyou, it all works great.

Page 1 of 1 (5 items)