10 places where you must use Ajax

Source: Internet
Author: User

From: javaeye.com

10 You must use Ajax LocationAuthor: Alex Bosworth Creation Time: Translator: benjaminz@eyou.com translation time: original address: http://www.sourcelabs.com/blogs/ajb/2005/12/10_places_you_must_use_ajax.html now from gmail changed everyone on the use of web applications has been more than a year. However, at present, many web applications do not use the dynamic Ajax advantages to replace the previously dull html functions. The following figure shows where the current webpage application should appear:  Form-based interactionThe form is very slow. Try to edit a bookmarks located on del. icio. us? Click the edit link to open a form page for editing bookmarks, edit your content, and click the submit button to wait until the entire submission process ends, finally, return to the previous page and scroll down to the bookmarks you just edited to check whether the content has been correctly changed. What about AJAX? Click the edit link to change the TAG content immediately. Click the submit button to start Asynchronous Transfer of the tag editing content and immediately view the changed content without reload the entire page. Deep tree navigationAll in all, applications with deep tree navigation are a nightmare. In most cases, simple and straight topology structure and search/tag can work well. However, if an application uses a deep tree navigation and uses JavaScript to manage the topology ui (user interface), Ajax lazy loading of deep data can reduce the server load. For example, it is very time-consuming to read a result with only one line to load the entire new page. Real-time user communicationIn a project that allows users to create real-time discussions InformationIn the announcement system, it is silly to force the user to see the reply after updating the page again and again. The reply should be real-time, and users should not be forced to always be obsessed with refreshing operations. Even if gmail has refreshed the inbox like hotmail/yahoo mail and refreshed the inbox tag, it does not fully use the Ajax function to prompt for new emails to arrive. Voting, selection or not, ratingIf the Ajax submission process does not have a coordinated UI prompt, It is very bad to use Ajax to submit a survey or choose whether to reduce the pain of waiting for the submission process. By reducing the click wait time, Ajax applications become more interactive-if it takes 40 seconds to submit a vote, most people will choose to give up unless they are very concerned. If it takes only one second, a large proportion of people will be willing to vote. (I have 2008 million movies voting on Netflix versus and 210 movies voting on IMDb.com) Filtering and complex data operationsApply a filter, sort by date, sort by date and name, enable or disable the filter, and so on. Any high-switch operation should be handed over to JavaScript for processing, rather than submitting a series of requests to the server. The changes in the view caused by searching or operating a large amount of data cannot exceed 30 seconds at most. Ajax actually accelerates these operations. Prompt during normal input/ Auto-completionSome software/JavaScript is good at helping users complete the work of typing the same text or predictable text. This function is very useful in del. icio. us and Gmail and can be used to quickly add tags/emails. For a frequently used application such as a webpage email client or blog reader, users have plenty of time to learn how to use new UI concepts, but they cannot accept a very slow response speed. This kind of application has played a perfect lever for the increasing popularity of Ajax. With the increase in user usage frequency, more Ajax components should enhance the user experience. However, for Web applications, it is meaningless to use JavaScript to implement everything. Ajax can only provide significant help for specific environments. Before the emergence of Ajax, web applications have been able to work well. Currently, Ajax still has many defects and shortcomings in Web development. Even if you do not obtain an asynchronous data stream from the server, a straight html web page log can work well. For redirection between documents, old pure HTML is still the best choice. Simple or rarely used applications can work well without JavaScript. Below are some examples that do not use Ajax Location:  Simple FormEven if the form is the biggest beneficiary of Ajax technology, an Ajax-driven form submission mechanism should not be used for forms with simple content, orders submitted, or forms rarely used at a time. In general, if a form is not very long or works well, Ajax is useless. SearchThe pain of real-time search is far greater than that of real-time search. This is why Google Suggest is still in beta testing and not on the homepage. When searching on Start.com Live.com, you cannot use the return button to view the previous search or previous page. Maybe no one has done the job yet, but it should be difficult, at least not knowing it, or it may cause more trouble. Now there are many open-source frameworks that can implement the history function) Basic navigationIn general, Using Ajax to navigate a basic website/program is a terrible idea. Who will spend better time writing code to simulate browser behavior for their programs? JavaScript is useless in navigation operations on the basic page. Replace a large amount of informationAjax can dynamically update a small part of the page without refreshing the entire page. But if most of the content on a page needs to be updated, why not get a new page from the server? Display operationAlthough Ajax seems to be a pure UI technology, this is not the case. It is actually a technology for data synchronization, operation, and transmission. To get a stable and clean web page program, it is wise not to use Ajax/JavaScript to directly complete the user interface. JavaScript can be distributed in a distributed manner and operate XHTML/html dom in a simple way. Based on CSS rules, you can determine how to display data in the UI. Click Here (http://www.sourcelabs.com/blogs/ajb/2005/08/powering_javascript_ui_with_cs.html) to see how CSS is used instead of JavaScript to control the display of data. Useless web widgetsSlider Selection control, Drag Control, elastic control (here the original is bouncies, I do not know why ?) Mouse style, weather forecast controls, these widgets should be replaced by more direct controls or simply removed for cleanliness. To select a color, You may select a correct shadow color for the slider Selection control, but select a price in a store, the unit of selecting points using the slider Selection control is too much for users. OK, I lied to the title, but I only told 6 places where Ajax should be used and 6 places where Ajax may not be used, but looking at this article from a four-dimensional perspective, I have built a wiki page (http://swik.net/Ajax/Places+To+Use+Ajax) on SWiK for Ajax use) and I or anyone else can improve him over time. Also, I am trying to use Feedburner to track my RSS seed now, if you haven't subscribed to Feedburner seed, please subscribe to http://feeds.feedburner.com/AlexBosworth here (this article reposted from http://benjaminz.javaeye.com/blog/59846)
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.