//异步加载js文件并调用函数  
function delayCall(calledFunction, funcParams, jsUrl)  
{  
    if (eval('typeof '+calledFunction) == 'function') {  
        eval(calledFunction+'(funcParams)');  
    } else {  
        jQuery.ajax({  
            type: 'GET',  
            url: jsUrl,  
            data: {},  
            dataType: 'script',  
            cache: true,  
            async: true,  
            success: function () {  
                eval(calledFunction+'(funcParams)');  
            }  
        });  
    }  
}  
  
//同步加载js文件  
function syncLoad(checkFunction, jsUrl)  
{  
    if (eval('typeof '+checkFunction) != 'function') {  
        jQuery.ajax({  
            type: 'GET',  
            url: jsUrl,  
            data: {},  
            dataType: 'script',  
            cache: true,  
            async: false,  
        });  
    }  
}  

http://blog.csdn.net/flynetcn/article/details/45058987

相关文章:

  • 2021-11-29
  • 2021-11-29
  • 2021-11-29
  • 2022-02-07
  • 2021-12-04
  • 2021-11-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-11
  • 2022-01-18
  • 2022-12-23
  • 2021-07-11
相关资源
相似解决方案