Lecture 10 - Ajax Flashcards
What is AJAX?
•AJAX = Asynchronous JavaScript and XML.
•Allows creation of interactive dynamic web content
•Rich Internet Application
–Designed to behave as per standard desktop applications while still deployed on the WWW.
•Ajax is not a specific product or technology. Set of technologies and techniques
•Small quantities of data exchanged with server.
What is Synchronous?
- Real time exchange
- Requestor waits for an answer
e. g. A Phone Call
What is Asynchronous?
•Executed in a non-blocking scheme
•Classic web apps are synchronous
–adopt a “click and wait” effectively blocking further user interaction while request is dealt with.
•Processes working independently, not waiting for each other
e.g. Sending a post card or Forums
What is the open method?
- GET is simpler and faster than POST, and can be used in most cases.
- However, always use POST requests when:
- A cached file is not an option (update a file or database on the server)
- Sending a large amount of data to the server (POST has no size limitations)
- Sending user input (which can contain unknown characters), POST is more robust and secure than GET
What ware the pros and cons of AJAX?
Pros:
1) User-experience improvement, decreasing delay
2) Decrease in bandwidth use.
3) Flexible in terms of languages
Cons:
1) Breaks the rule of presentation separated from content
2) Requires JavaScript – therefore need to use noscript tag for browsers that do not support it.
3) Data loaded dynamically and thus not crawled/indexed.
What does the the XMLHttpRequest Object do?
•Modern browsers (IE7+, Firefox, Chrome etc) support XMLHttpRequest object. It can:-
–Update page without refresh/reloading
–Request data from server after the page has loaded
–Receive data from a server after the page has loaded
–Send data to a server in the background
What is the Ajax Dialog that takes place?
Draw out the architecture for Classic Web Application and the AJAX Application?