争怎路由网:是一个主要分享无线路由器安装设置经验的网站,汇总WiFi常见问题的解决方法。

zepto是什么

时间:2024/4/29作者:未知来源:争怎路由网人气:

triggerGlobal(settings, context, 'ajaxBeforeSend', [xhr, settings]) === false) return false triggerGlobal(settings, context, 'ajaxSend', [xhr, settings]) } function ajaxSuccess(data, xhr, settings) { var context = settings.context, status = 'success' settings.success.call(context, data, status, xhr) triggerGlobal(settings, context, 'ajaxSuccess', [xhr, settings, data]) ajaxComplete(status, xhr, settings) } // type: "timeout", "error", "abort", "parsererror" function ajaxError(error, type, xhr, settings) { var context = settings.context settings.error.call(context, xhr, type, error) triggerGlobal(settings, context, 'ajaxError', [xhr, settings, error]) ajaxComplete(type, xhr, settings) } // status: "success", "notmodified", "error", "timeout", "abort", "parsererror" function ajaxComplete(status, xhr, settings) { var context = settings.context settings.complete.call(context, xhr, status) triggerGlobal(settings, context, 'ajaxComplete', [xhr, settings]) ajaxStop(settings) } // Empty function, used as default callback function empty() {} //可参考http://zh.wikipedia.org/zh-cn/JSONP $.ajaxJSONP = function(options) { if (!('type' in options)) return $.ajax(options) var callbackName = 'jsonp' + (++jsonpID), //创建回调函数名 script = document.createElement('script'), //js文件加载完毕 cleanup = function() { clearTimeout(abortTimeout) //清除下面的timeout事件处理 $(script).remove() //移除创建的script标签,因为该文件的JS内容已经解析过了 delete window[callbackName] //清除掉指定的回调函数 }, //取消加载 abort = function(type) { cleanup() // In case of manual abort or timeout, keep an empty function as callback // so that the SCRIPT tag that eventually loads won't result in an error. //这里通过将回调函数重新赋值为空函数来达到看似阻止加载JS的目的,实际上给script标签设置了src属性后,请求就已经产生了,并且不能中断 if (!type

关键词:zepto是啥




Copyright © 2012-2018 争怎路由网(http://www.zhengzen.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版