Reputation: 7979
I have a main page most of the part of the page is loaded as non-Ajax.
A portion of a page is loaded as Ajax action.
If I click any link on the non-Ajax section the on the site, the page is redirected to new page only after the Ajax action is completed.
How can I make the redirection happen with out completing the Ajax action
Upvotes: 0
Views: 76
Reputation: 165
function redirect(callback){
$.ajax({
data: {somedate},
async:true,
complete: function(){
callback()
}
})
}
Upvotes: 0
Reputation: 41
Try use this method
function redirect(callback){
$.ajax({
data: {somedate},
complete: function(){
callback()
}
})
}
Upvotes: 0
Reputation: 499
you should use asynchronous ajax request, like this:
open(method,url,async)
the 'async' parameter specifies the request to be asynchronous or not, its a boolean parameter, set it to true like this:
open(method,url,true)
Upvotes: 1