[jQuery] Ajax chaining
[jQuery] Ajax chaining
Hi all,
I have a page that I want to use to display updates coming from the
server.
In my innocence, I assumed that the following code:
function get_status(response){
$("#selector").text(response);
$.ajax({
type: "GET",
url: <server url>,
success: get_status(response)
});
}
and server side something that sends a response, would give me
successive ajax calls, made visible in the page via #selector.
However, this does not happen. response comes back as an empty string,
even though I can test the url and it gives me data (time() in this
case, just for testing).
What am I doing wrong here? Is AJAX reciursion evil?
Cheers,
-Erik