I have a sample app developed in asp.NET 3.5. On my master page I use following code to display an GIF while loading the page. It works correctly on IE and FF, but fails in Chrome. On pressing the submit button, the server gets the request and completes its processing and while that is happening the browser shows the loading GIF as expected.However the postback never completes and user keeps on looking at the progress GIF. I wonder where I have goofed up... Pls help!
// Get the instance of PageRequestManager.
var prm = Sys.WebForms.PageRequestManager.getInstance();
// Add initializeRequest and endRequest
prm.add_initializeRequest(prm_InitializeRequest);
prm.add_endRequest(prm_EndRequest);
// Called when async postback begins
function prm_InitializeRequest(sender, args) {
// get the divImage and set it to visible
var panelProg = $get('divImage');
if( panelProg != null)
{
panelProg.style.display = '';
// Disable button that caused a postback
$get(args._postBackElement.id).disabled = true;
}
}
// Called when async postback ends
function prm_EndRequest(sender, args) {
// get the divImage and hide it again
var panelProg = $get('divImage');
if(panelProg != null)
{
panelProg.style.display = 'none';
$get(sender._postBackSettings.sourceElement.id).disabled = false;
}
}
My divImage is simple
<div id="divImage" style="display: none">
<img id="imgId1" src="../../App_Themes/Images/progressbar.gif" style="border-width:0px;" />
<br />
Please wait...
</div>
Add the following script to your page.
<script type="text/javascript">
Sys.Browser.WebKit = {}; //Safari 3 is considered WebKit
if( navigator.userAgent.indexOf( 'WebKit/' ) > -1 )
{
Sys.Browser.agent = Sys.Browser.WebKit;
Sys.Browser.version = parseFloat( navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]);
Sys.Browser.name = 'WebKit';
}
</script>
See more at: http://blog.joeydaly.com/uncaught-sys-scriptloadfailedexception-sys-scriptloadfailedexception
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With