1 var fun = "testFun"; // 函数的名称 2 try{ 3 if($.isFunction(fun)){ eval("testFun('txt')"); // "txt"是函数参数
5 }
6 }catch(e){
7 $.alert(fun +'不是函数!');
8 }
注意使用“eval()”!!!
1 var fun = "testFun"; // 函数的名称 2 try{ 3 if($.isFunction(fun)){ eval("testFun('txt')"); // "txt"是函数参数
5 }
6 }catch(e){
7 $.alert(fun +'不是函数!');
8 }
注意使用“eval()”!!!
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。