Skip to content

Instantly share code, notes, and snippets.

@swainet
Created July 25, 2013 08:34
Show Gist options
  • Save swainet/6077898 to your computer and use it in GitHub Desktop.
Save swainet/6077898 to your computer and use it in GitHub Desktop.
seajs异步载入
// sea.js 的异步载入代码:
;(function(m, o, d, u, l, a, r) {
if(m[o]) return
function f(n) { return function() { r.push(n, arguments); return a } }
m[o] = a = { args: (r = []), config: f(1), use: f(2), on: f(3) }
m.define = f(0)
window.addEventListener('load', function () {
u = d.createElement("script")
u.id = o + "node"
u.async = true
u.src = "http://assets.dev.alipay.net/??handy/base/1.1.0/seajs-intro.js,seajs/seajs/2.1.1/sea.js,seajs/seajs-combo/1.0.0/seajs-combo.js,handy/jquto/1.0.2/jquto.js,handy/base/1.1.0/seajs-outro.js"
l = d.getElementsByTagName("head")[0]
l.appendChild(u)
});
})(window, "seajs", document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment