Home  >  Article  >  Backend Development  >  javascript - How to switch pages when ajax does not end (when background thinkPHP does not process completion)?

javascript - How to switch pages when ajax does not end (when background thinkPHP does not process completion)?

WBOY
WBOYOriginal
2016-08-18 09:16:15929browse

HTML page ajax accesses the php backend. Since php responds slowly, when I want to switch pages, I find that the page is stuck and blocked. How to solve this problem? I would be very grateful if you could explain the principle.

Reply content:

HTML page ajax accesses the php backend. Since php responds slowly, when I want to switch pages, I find that the page is stuck and blocked. How to solve this problem? I would be very grateful if you could explain the principle.

  • If this ajax request requires background processing of time-consuming tasks, it can be resolved asynchronously.

  • If you need the response content after the server processes it, you can use websocket.

What do you mean by switching pages?

Ajax response time is slow. It has nothing to do with your page being stuck. Please give me more details

First of all, check whether asynchronous requests are used. If so, then the two things you mentioned should be unrelated, right?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn