版主好,能看下这个链接么?http://www.cnblogs.com/sharpxiajun/archive/2012/04/26/2471990.html
里面说“asyn:false,这个参数我设置过,效果一样的,应该说XMLHttpRequest是重新开启了个http连接,我们的ajax函数只是封装请求信息,并且调用它,因为是内部独立的http链接,XMLHttpRequest是独立运行的,和原来的ajax函数无关”
我自己还没熟悉ajax怎么写,所以现在还不能改写我的代码成ajax。[/quote]
博客乱扯吧?那个参数就是锁定浏览器不让操作的!
还是看官方的解释:
async (default: true)
Type: Boolean
By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success().
http://api.jquery.com/jQuery.ajax/