jsonp is not firing beforeSend?

一世执手 提交于 2019-12-03 20:09:37

Cross-domain JSONP requests do not use XMLHTTPRequest, so the event flow is different.

You can simply show your loading animation right after calling $.ajax.

beforeSend implemention for jQuery JSONP is sill in progress. The solution for now, use:

jQuery(document).ajaxStart(function(){alert('Before Send');}); // For all XHRs
$('#id').ajaxStart(function(){alert('Before Send');});         // For unique XHR

before $.ajax({...});.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!