[英]Javascript callback not working, running callback before ajax request has finished
[英]AJAX request is not sent before previous request is not finished
我看到奇怪的行为,即在上一个请求(不是AJAX)完成之前,AJAX请求被卡住了。
我有一个网页,正在播放使用HTML5的视频,在此期间我想向服务器发出AJAX请求。
以下是我的案例的一些细节。 这是请求被卡住时的样子。 第一个是视频,第二个是我要发送的AJAX,在第一个完成之前它没有任何地方。
仅使用普通jQuery的$ .ajax()调用发送Ajax请求。
这是阻止AJAX请求的视频请求的请求和响应信息。
Request GET /portal/portlet/index/id/671/call/proxyVideo?entityId=1 HTTP/1.1
Accept */*
If-Unmodified-Since Fri, 24 Apr 2015 08:18:29 GMT
If-Match "f91b54d-514740a87ff40"
Range bytes=360448-261207372
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Referer http://mm.mac/content
GetContentFeatures.DLNA.ORG 1
Pragma getIfoFileURI.dlna.org
Accept-Language en-US
Accept-Encoding gzip, deflate
Host mm.mac
Connection Keep-Alive
Cache-Control no-cache
Cookie PHPSESSID=41821op72k2s24mfrsbn5gad64
Response HTTP/1.1 206 Partial Content
Date Tue, 01 Dec 2015 13:39:31 GMT
Server Apache/2.4.16 (Unix) PHP/5.6.13
X-Powered-By PHP/5.6.13
Expires Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma no-cache
Last-Modified Fri, 24 Apr 2015 08:18:29 GMT
ETag "f91b54d-514740a87ff40"
Accept-Ranges bytes
Content-Length 260846925
Access-Control-Allow-Methods GET
Content-Range bytes 360448-261207372/261207373
Keep-Alive timeout=5, max=100
Connection Keep-Alive
Content-Type video/mp4
我的问题是为什么AJAX请求被阻止,如何使它工作?
PS:控制台不会报告任何错误或警告。
在ajax参数中使async:true
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.