记录一下今天遇到的坑 使用 eval()将 字符串转化为 函数的时候,不能转function()这类匿名函数,解决方法是 var str1="function(){alert('aa');}"; (new Function("return " + str1))()