On Chrome ajax async postback end not working

I have an example application developed in asp.NET 3.5. On my main page, I use the following code to display GIFs while the page loads. It works correctly with IE and FF, but does not work in Chrome. When the "Send" button is clicked, the server receives the request and completes its processing, and although this happens, the browser shows the loaded GIF, as expected. However, postback never ends, and the user continues to look at the GIF progress. I wonder where I was going to ... Help, please!

                             // 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>
+3
source share
2 answers

script.

<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>

. : http://blog.joeydaly.com/uncaught-sys-scriptloadfailedexception-sys-scriptloadfailedexception

+2

ajax Chrome dev (localhost .something). , Chrome . ?

, URL- dev .

0

Source: https://habr.com/ru/post/1772701/


All Articles