So when eval(data) is complete, how would you set a callback?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Eval is not asynchronous, so you don’t need a callback. Just put your function call on the next line.
The script you are evalling might do something asynchronous, in which case you would need to parse the JS, find the asynchronous code, and add a callback to that (in string form).
Best to avoid eval in the first place though. It is almost never the right solution to a problem.