0

i have following in a string.

javascript: __doPostBack('GridWidget', 'Edit0ドル')

how can i dynamically execute this?

Marcel Korpel
21.9k6 gold badges63 silver badges80 bronze badges
asked Sep 4, 2010 at 23:11
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.

answered Sep 4, 2010 at 23:14
Sign up to request clarification or add additional context in comments.

Comments

0
var js = "javascript: __doPostBack('GridWidget', 'Edit0ドル')".replace("javascript:","");
eval(js)
answered Sep 4, 2010 at 23:14

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.