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

zepto是什么

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

'abort', xhr, options) }, xhr = { abort: abort }, abortTimeout if (ajaxBeforeSend(xhr, options) === false) { abort('abort') return false } //成功加载后的回调函数 window[callbackName] = function(data) { cleanup() ajaxSuccess(data, xhr, options) } script.onerror = function() { abort('error') } //将回调函数名追加到请求地址,并赋给script,至此请求产生 script.src = options.url.replace(/=\?/, '=' + callbackName) $('head').append(script) //如果设置了超时处理 if (options.timeout > 0) abortTimeout = setTimeout(function() { abort('timeout') }, options.timeout) return xhr } //ajax全局设置 $.ajaxSettings = { // Default type of request type: 'GET', // Callback that is executed before request beforeSend: empty, // Callback that is executed if the request succeeds success: empty, // Callback that is executed the the server drops error error: empty, // Callback that is executed on request complete (both: error and success) complete: empty, // The context for the callbacks context: null, // Whether to trigger "global" Ajax events global: true, // Transport xhr: function() { return new window.XMLHttpRequest() }, // MIME types mapping accepts: { script: 'text/javascript, application/javascript', json: jsonType, xml: 'application/xml, text/xml', html: htmlType, text: 'text/plain' }, // Whether the request is to another domain crossDomain: false, // Default timeout timeout: 0, // Whether data should be serialized to string processData: true, // Whether the browser should be allowed to cache GET responses cache: true }; //根据MIME返回相应的数据类型,用作ajax参数里的dataType用,设置预期返回的数据类型 //如html,json,scirpt,xml,text function mimeToDataType(mime) { if (mime) mime = mime.split(';', 2)[0] return mime && (mime == htmlType ? 'html' : mime == jsonType ? 'json' : scriptTypeRE.test(mime) ? 'script' : xmlTypeRE.test(mime) && 'xml')

关键词:zepto是啥




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

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

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