Execute dynamic code
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)
精彩评论