简体   繁体   中英

Load page into div before ajax success

I have a website on which I load subpages into container div through jquery.load().

On one subpage after user fill in form and submits it. I use ajax to process this form. It is a long process (php search big database) and until I get success I cannot move to another supage because when i click other navigation button it stills on load() functions and waits until this ajax is finished. I dont want to freeze navigation because of this ajax did not finished. So load() cannot be executed until ajax finish? How to do that?

I would change my .load()'s into jQuery.get()'s . Then, I'd cancel my ajax call when the user clicks another nav button. Abort Ajax requests using jQuery . jQuery.get() returns a XHR (or equivelant) object just like $.ajax does.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM