//异步加载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

05-13 18:52