开发者

Execute dynamic code

开发者 https://www.devze.com 2023-01-14 06:05 出处:网络
i have following in a string. javascript: __doPostBack(\'GridWidget\', \'Edit$0\') how can i dynamically exec开发者_运维问答ute this?Remove the \"javascript:\" from the front, and call eval() on th

i have following in a string.

javascript: __doPostBack('GridWidget', 'Edit$0')

how can i dynamically exec开发者_运维问答ute this?


Remove the "javascript:" from the front, and call eval() on the string.


var js = "javascript: __doPostBack('GridWidget', 'Edit$0')".replace("javascript:","");
eval(js)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号