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>
Blarm1959
0 Points
3 Posts
Firefox 3 problem with Sys.Application.add_load
Jun 27, 2008 08:38 AM|LINK
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>gt1329a
All-Star
15377 Points
2501 Posts
ASPInsiders
MVP
Re: Firefox 3 problem with Sys.Application.add_load
Jun 27, 2008 01:55 PM|LINK
A guide to combining jQuery and ASP.NET: jQuery for the ASP.NET developer
Blarm1959
0 Points
3 Posts
Re: Firefox 3 problem with Sys.Application.add_load
Jun 30, 2008 09:46 AM|LINK
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
gt1329a
All-Star
15377 Points
2501 Posts
ASPInsiders
MVP
Re: Firefox 3 problem with Sys.Application.add_load
Jun 30, 2008 12:20 PM|LINK
A guide to combining jQuery and ASP.NET: jQuery for the ASP.NET developer
Blarm1959
0 Points
3 Posts
Re: Firefox 3 problem with Sys.Application.add_load
Jul 01, 2008 11:31 AM|LINK
Thankyou, it all works great.
sajithkahawa...
Member
17 Points
8 Posts
Re: Firefox 3 problem with Sys.Application.add_load
Sep 07, 2010 09:04 AM|LINK
All you need to do is rename the function that you need to run on pageload/postback to pageLoad and it automagically works in all browsers.
function pageLoad(sender, args) {
//Do your work
}