I have a simple post, which executed the data returned as a script as such:
$.post("/home", { foo: 'bar' }, function(){
//callback function
}, "script");
Here's what happens:
- The request gets sent
- A piece of JS code is returned as a response and executed
- The callback is executed
I need the callback to be executed before the returned JS is executed. Is there a way to achieve this?
Thanks!