我不知道该怎么做,请帮忙.解决方案如果您特别想使用jQuery, $.getscript("Sub.js",function(){第二();}); My question:I have 2 files://Sub.jsfunction Second() { //do something here}//Main.jsfunction One() { //do something here}$(function() { Second();});So basically, the function Second is too long; therefore, I want to move it to a Sub.js file and call it from the Main.js. The problem is this function ( function Second) has to be executed after function One because it gets some data from the function One output.I don't know how to do this, please help. 解决方案 If you specifically want to use jQuery, $.getscript("Sub.js",function(){ Second();}); 这篇关于如何使用jQuery从另一个文件调用JavaScript函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-02 04:54