且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

eval()函数和附加脚本标记之间的Javascript差异

更新时间:2023-12-05 17:49:58

那么一(尽可能的差异去)是评估返回的前$ P结果$ pssion。

Well one (as far as differences go) is eval will return the result of an expression.

var result = eval('3+4'); // result = 7 

只要你的JavaScript字符串在脚本块的结构,我想提出一个脚本标签中注入它/

As long as your javascript string is in the structure of a script block, i would suggest injecting it within a script tag/