By Kris Hadlock
Read or Download Ajax for Web Application Developers (Developer's Library) PDF
- Web Programming with Dart
- Beginning JSON
- .net (September 2015)
- Grunt Cookbook
Extra resources for Ajax for Web Application Developers (Developer's Library)
7. innerHTML += "------------
"; } Parsing requested XML is fairly simple if you know what format to expect as the response from the server. If we did not know what to expect in the previous example of the response, we could have started by using the responseText property to display the XML structure as a string and decipher what tags we needed to target. responseText; alert(response); } } This would have provided us with the entire XML structure in an alert prompt. At that point, we would be able to take a look at the structure and figure out what we wanted to parse with the responseXML property.
In other words, you can make a request to the server, continue to process other data, and receive a response at the server’s leisure, thus making web applications very flexible. This means that the request/response data is not transferring at predetermined or regular set intervals. For example, you can make an HTTP request to a server and continue to process other client-side interactions while waiting for the response in the background. You can also send data to a server-side language to be stored in a database, or you can simply load a static XML, JSON, or text file to dynamically populate pages of your website without refreshing the page or interrupting user interaction on the front end.
However, deciding on a single format for your application can be useful as a convention for future management, especially if you are building a large-scale application. This might differ from one application to the next but, if possible, it is an important theory to keep in mind. It is also good to keep in mind the scalability of the technology that you choose, especially if you are planning on creating a scalable application in which you expect exponential growth. Let’s get started by taking an in-depth look at XML, the syntax, how to parse it, and how to use it in your next application.
Ajax for Web Application Developers (Developer's Library) by Kris Hadlock