javascript 将字符串当函数执行

//语法

eval(str);

 

//demo

var t = "func";

eval(''+func+'()');

posted @ 2017-05-16 20:33  抱明月  阅读(219)  评论(0编辑  收藏  举报