jquery:如何将其他.js文件包含到.js中 [英] jquery: how to include other .js-files into .js
本文介绍了jquery:如何将其他.js文件包含到.js中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有任何jquery插件(而不是incldeMany)或简单的函数来按需包含js文件?
Is there any jquery plugin (instead of incldeMany) or simple function to include js-files on demand ?
例如:
$.include('myscript.js');
?
推荐答案
jQuery.getScript()怎么样?它内置于jQuery中,其工作原理如下:
How about jQuery.getScript()? It's built in to jQuery and works like so:
$.getScript('ajax/test.js', function() {
alert('Load was performed.');
});
这篇关于jquery:如何将其他.js文件包含到.js中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文