0

i have following in a string.

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

how can i dynamically execute this?

1
  • 2
    Lets me wonder: where does this string come from? Can't you include this in a static JS file? If it's really dynamic (e.g., user input), you're creating a huge security hole. Commented Sep 4, 2010 at 23:17

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.