Reputation: 23
i have following in a string.
javascript: __doPostBack('GridWidget', 'Edit$0')
how can i dynamically execute this?
Upvotes: 0
Views: 1365
Reputation: 28894
var js = "javascript: __doPostBack('GridWidget', 'Edit$0')".replace("javascript:","");
eval(js)
Upvotes: 0
Reputation: 7940
Remove the "javascript:" from the front, and call eval() on the string.
Upvotes: 1