开发者

JQuery and AJAX async callback makes browser wait?

开发者 https://www.devze.com 2023-03-17 16:43 出处:网络
I\'m developing my first pages in mvc3 using the razor view engine. When my page loads I want to asynchronously go back to the server and calculate some dynamic content. I\'m using the $.ajax({..}) jq

I'm developing my first pages in mvc3 using the razor view engine. When my page loads I want to asynchronously go back to the server and calculate some dynamic content. I'm using the $.ajax({..}) jquery function to post back to a controller method etc;

$(document).ready(function() {

   // Code to collect relevant data...

   $.ajax({

      type: 'POST',
      traditional: true,
      url: 'MyControllerMethod',
      data: object(s),
      dataType: 'json',
      success: function(x) {

         // Code to deal with returned data...

      }

});

Everything is ok apart 开发者_如何学JAVAfrom I notice the browser is displaying a busy cursor whilst my AJAX callback is occurring and doesn't return to the normal 'arrow' untilt the AJAX request has finished. Could anyone enlighten me as isn't this supposed to be an Asynchronus callback?

Regards.


To answer my own question is to point you to this SO thread,

Chrome AJAX on page-load causes “busy cursor” to remain

0

精彩评论

暂无评论...
验证码 换一张
取 消