Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Dữ liệu lấy từ PHP bằng cách sử dụng jQuery giải thích. Get () phương pháp chi tiết Tạo một chuỗi truy vấn tự động cho tất cả các yếu tố hình thức xử lý sai sót trong AJAX yêu cầu, trong đó cho thấy làm thế nào để xử lý các lỗi gặp phải trong các yêu cầu AJAX | Simpo PDF Merge and Split Unregistered Version - http www.simpopdf.com Combining PHP and jQuery------------------------------------------------------- information .hide response .html response Since .ajax gives more flexibility than .post you can use it when you want to have a specific error callback function for request. See also Fetching data from PHP usingjQuery explains the .get method in detail Creating a query string automatically for all form elements Handling errors in AJAX requests which shows how to handle errors encountered during AJAX requests Aborting AJAX requests Consider a case where a user is allowed to select a date on a page and an AJAX request is made to the server to fetch some data against that date. If the request is under processing and in the meantime the user selects another date and a new request is sent the server now has two requests pending. Imagine what will happen to an application if there are multiple users repeating the same behavior. Desirable behavior in this case will be to cancel the pending request and allow only the current one. This recipe will explain how to cancel any pending requests. Getting ready Create a new folder in chapter2 directory and name it as Recipes. How to do it. 1. We will use the same markup that we created in the first recipe of this chapter. So create a new file index.html and write the code to create an HTML page with a combo box and two options. Also create a paragraph element on the page that will display the received response. html head title Aborting ajax requests title style type text css 56 Simpo PDF Merge and Split Unregistered Version - http www.simpopdf.com 2. --------------------------------------------------------------Chapter 2 ul border 1px solid black list-style none margin 0pt padding 0pt float left font-family Verdana Arial Helvetica sans-serif font-size 12px width 300px li padding 10px 5px border-bottom 1px solid black style head body form p Show list of select id choice option value .