10 errors that are often made using Ajax

Source: Internet
Author: User
Tags object http request browser cache
Always remember that there are a few visitors who can't use JavaScript or older browsers or they don't support JavaScript, like mobile devices. If none of this is supported, what can your visitors see?

1. Do not update the entire page by placing the entire page in UpdatePanel. You need to save time while you run the Web page, and don't update those parts that can use JavaScript and DHTML (DOM).

2, always remember that there are so many visitors, they can not use JavaScript or the version of the older browser or they do not support JavaScript, such as mobile devices. If none of this is supported, what can your visitors see?

3, in the client browser cache the same request or on the we server to execute the cache. The best example is to automatically complete a drop-down menu, their fill at any time is the same, an automatic completion of the wrong way of writing can slow down your Web server (database server), because there will be more than previously used IsPostBack request. Think about the situation where you keep pressing F5 to refresh your Web page. If you have a cascading pull-down menu, you'll settle for more requests.

4, when you use CSS or JavaScript, do not run, concurrent or run for a long time Ajax requests, the general browser can only have two concurrent HTTP connection (I know can be changed this, but the default is set to two). If you read a picture by a lot of Ajax requests, the speed will become very slow.

5, when all use the method of asynchronous call send XMLHttpRequest ... If you want to use the Synchronized method is also not to ask questions, your browser will not be because of network problems or slow connection speed and frozen

6. Try to get your Web application to use a slow network connection and try a fast TCP/IP connection

7. Is your Web application a substitute for desktop programs? You've looked at the use of memory in a typical browser that runs your Web application for an hour, two hours, or days. Not everyone has a good machine like you.

8. Check your Http request status codes (status code) when you return to XMLHttpRequest, and there will be some common network errors like Dns,http Server Error 500, where you have checked the status code Code), it can tell you the browser in a mode for the connection

9, try to prohibit XMLHttpRequest object! With IE7 you can use native object instead of ActiveX object, but you can also ban native object.

10, check your AJAX requests security! Did you simply open up your data access layer? Make full use of FormsAuthentication and principalpermissions. Is it possible for anyone to create a request (not just click on a link)?



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.