您的位置:365bet手机在线 > Web前端 > Web前端之家

Web前端之家

发布时间:2019-11-22 18:38编辑:Web前端浏览(181)

    一、语法:loadScript或者loadScript二、settings支持的参数:url:脚本路径async:是否异步,默认falsecharset:文件编码cache:是否缓存,默认为truesuccess:加载成功后执行的函数,优先执行callback。三、调用举例:复制代码 代码如下://loadScriptloadScript(“ 代码如下:function loadScript {var head = document.head || document.getElementsByTagName[0] || document.documentElement,script,options,if (typeof url === “object”) {options = url;url = undefined;}s = options || {};url = url || s.url;callback = callback || s.success;script = document.createElement;script.async = s.async || false;script.type = “text/javascript”;if {script.charset = s.charset;}if{url = url+ ? “&” : “?” )+ “_=” +;}script.src = url;head.insertBefore(script, head.firstChild);if{document.addEventListener ? script.addEventListener(“load”, callback, false) : script.onreadystatechange = function() {if (/loaded|complete/.test {script.onreadystatechange = nullcallback()}}}}

    本文由365bet手机在线发布于Web前端,转载请注明出处:Web前端之家

    关键词:

上一篇:没有了

下一篇:没有了