$(function() {
function x() {
$.ajax({
cache: false,
type: "post",
data: 'messages=' + 5,
url: 'http://url.com',
complete: function(data) {
x(true);
},
error: function(x, t, m) {
alert(t);
},
dataType: "text"
});
}
})
If I use comet approach and I don't get response from url.com and I press on logo, for example, then it gives me alert "error", but I still need to wait until I get response from url.com to be able to go to other page. I guess I should do something in this part instead of alert:
error: function(x, t, m) {
alert(t);
},
Not sure what.
EDIT: I want that person who clicked on the logo or any other link, would be redirected there instantly, not waiting for an ajax response.