我已经创建了一个全局处理程序ajaxSuccess
,但我需要能够检查每个请求的数据。此时是否可以访问返回的数据?
jQuery(document).ajaxSuccess(function(event, request, options) {
// i can has the datas? >^..^<
});
Run Code Online (Sandbox Code Playgroud)
这适用于 FF、Chrome、IE 8:
jQuery(document).ajaxSuccess(function(event, request, options) {
if (options.dataType == 'json') {
var data = JSON.parse(request.responseText);
// i has the datas!
}
});
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
845 次 |
最近记录: |