tags:

views:

27

answers:

2

i have following in a string.

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

how can i dynamically execute this?

+1  A: 

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

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