So when eval(data) is complete, how would you set a callback?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With