Is single page application applicable to you? Ajax is not omnipotent

Source: Internet
Author: User

The company's new project started, and the front-end part of the project was changed from webwork to GWT. So we have been watching GWT these days, combining jquery and prototype that we used before, some ideas are recorded on the blog.

 

Due to the partial refresh function of Ajax, many systems have changed to single page application, that is, the application only has one page and updates the content of this page according to different user operations, although this approach simplifies the development of the System UI (is it really simplified? It may be a psychological simplification) and keeps System Development up with the Ajax trend of web development. But is this one-size-fits-all single-page model really suitable for your applications? Consider the following aspects:

 

1. Do your applications need to be indexed by search engines? As far as I know, all search engines still hate Javascript. That is to say, Dynamic Content Search Engines updated with Ajax on your page cannot be accessed. Therefore, if your website needs to be promoted by search engines, it is better to use traditional methods.

 

2. Do you need the back button of the browser for your application? Almost all browser users frequently use the browser's back button every day to view the content they have just browsed. However, if you use Ajax for partial refresh, the browsed content cannot be reproduced with the back button. Currently, all I know is that GWT uses the IFRAME method to implement the back button function:

<IFRAME src = "javascript:'' "id =" _ gwt_historyframe "tabindex = '-1' style =" position: absolute; width: 0; Height: 0; Border: 0 "> </iframe>, but the specific solution is not studied.

 

3. Do your applications want users to add a page to favorites? The characteristic of Ajax single-page applications is that the URL in the address bar does not have a one-to-one correspondence with the content displayed in the browser, therefore, the content displayed when the user's favorite page is re-opened may be different from the content displayed in the favorites page.

 

4. Is your application page complex? Do I need to update complex pages with Ajax? Ajax uses XML, text, and other texts to interact with the server. A large amount of transmission not only affects the system performance, but also poses a great threat to system security.

 

5. another problem we encountered before was the IE cache problem. At that time, the solution was to add a random parameter after the URL each time an Ajax request was sent, I don't know if the problem has been solved, or else it is also a problem to be considered.

 

The above several aspects may already have a solution. The development problem should be solved by development. I hope Ajax technology will develop faster!

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.