- //异步加载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,
- });
- }
- }
08-29 19:43