Đang chuẩn bị liên kết để tải về tài liệu:
Developing Large Web Applications- P22

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Developing Large Web Applications- P22:This book presents a number of techniques for applying established practices of good software engineering to web development—that is, development primarily using the disparate technologies of HTML, CSS, JavaScript, and server-side scripting languages. Whereas there are many books on how to use languages, how to use libraries, and how to approach software engineering, this is the first book to codify many of the techniques it presents. These techniques will make the components of your own web applications more reusable, maintainable, and reliable | Do what is needed when the Ajax call returns on a failure. _ POST The following method executes an Ajax POST request with jQuery. The parameters for the method are the same as described for GET except you set the type member to POST jQuery.ajax url service.php type POST timeout 5000 data keyl vall key val2 . dataType json success function data Do what is needed when the Ajax call returns successfully. error function xhr text error Do what is needed when the Ajax call returns on a failure. _ Ajax with Prototype Prototype is one of the earliest of the JavaScript libraries to support Ajax. You can download the library and read its complete documentation at http www.prototypejs .org-. GET The following method executes an Ajax GET request with Prototype. The method accepts two parameters the destination for the request and an object whose most common members are shown below. In the handler specified by onSuccess you access transport.responseText for responses using plain text. For XML responses transport.responseXML will have been populated with a DOM that you can access with JavaScript DOM methods. For JSON responses the transport.responseJSON member will have been populated with the JavaScript object that is the result of the evaluated response text. You specify the query parameters for the GET as an object in the parameters member In the Browser 191 Ajax.Request service.php method get parameters keyl vall key2 val2 . onSuccess function transport Do what is needed when the Ajax call returns successfully. onFailure function transport Do what is needed when the Ajax call returns on a failure. POST The following method executes an Ajax POST request with Prototype. The parameters for the method are the same as described for GET except you set the method member to post Ajax.Request service.php method post parameters keyl vall key2 val2 . onSuccess function transport Do what is needed when the Ajax call returns successfully. onFailure function transport Do what is needed .