Home >Web Front-end >JS Tutorial >Summary of advantages and disadvantages of Ajax
This time I will bring you a summary of the advantages and disadvantages of Ajax. What are the precautions for using Ajax? The following is a practical case, let's take a look.
Advantages of ajax
Disadvantages of ajax
Now I will focus on the shortcomings of ajax, because usually we mostly pay attention to what ajax brings to us. The benefits include improved user experience. The shortcomings caused by ajax have been ignored.The defects of ajax described below are all caused by its innateness.
1. Ajax kills the back button, which destroys the browser's back mechanism. The back button is an important feature of a standard web site, but it doesn't work well with JavaScript. This is a serious problem caused by ajax, because users often hope to cancel the previous operation by going back. So is there any solution to this problem? The answer is yes. Those who have used Gmail know that the ajax technology used under Gmail solves this problem. You can go back under Gmail. However, it does not change the ajax mechanism. It just uses a stupid but effective one. The way to do this is by creating or using a hidden IFRAME to reproduce the changes on the page when the user clicks the back button to access the history. (For example, when the user clicks back in Google Maps, it 2. 3. The support for searchindex engines is relatively weak.
4. Destroyed the exception mechanism of the program. At least from the current perspective, ajax frameworks such as ajax.dll and ajaxpro.dll will destroy the exception mechanism of the program. Regarding this problem, I have encountered it during the development process, but after checking, there is almost no relevant introduction on the Internet. Later, I did an experiment myself, using ajax and traditional form submission modes todelete a piece of data... which brought great difficulties to our debugging.
5. In addition, there are some other problems, such as violating the original intention of URL and resource positioning. For example, if I give you a URL address, if Ajax technology is used, maybe what you see under the URL address is different from what I see under this URL address. This is contrary to the original intention of resource positioning. 6. Some handheld devices (such as mobile phones, PDAs, etc.) currently do not support ajax very well. For example, when we open a website using ajax technology on the mobile browser, it currently does not support it. , of course, this issue has nothing to do with us. I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website! Recommended reading:Detailed explanation of the use of Ajax() to interact with the background
Detailed explanation of methods for handling WebService cross-domain issues
The above is the detailed content of Summary of advantages and disadvantages of Ajax. For more information, please follow other related articles on the PHP Chinese website!