Jquery:使用 $.holdReady(true); $.getScript(); $.holdReady(false) 3个函数实现
$.holdReady(true); //hold住,等待a.js加载,后续代码不能执行 $.getScript('a.js',function(){ $.holdReady(false); //释放,a.js加载完成,继续执行后续代码 });
$.holdReady()函数表示 延迟加载。
整理自:https://www.cnblogs.com/telnetzhang/p/5827791.html