(a) An XML document with correct syntax is said to be ‘well formed’. What syntax
ID: 3692669 • Letter: #
Question
(a) An XML document with correct syntax is said to be ‘well formed’. What syntax rules do XML documents need to comply with? [5 marks]
(b) The term AJAX is an acronym for Asynchronous Javascript and XML.
(i) What is the main use of AJAX interactions between a client and a server? [4 marks]
(ii) Explain what the terms synchronous and asynchronous mean in this context. [4 marks]
(iii) Interactions between a client and a server using AJAX can use various different data formats. List three such data formats. [3 marks]
(c) Give an example of how AJAX might be used by a commercial web site, the details of the interactions that would need to take place and the benefits this would have for improving the user interface.
Explanation / Answer
Ans (a) : Syntax Rules
(b) (i) Ajax is a set of web development techniques using many web technologies on the client-side to create asynchronous Web applications. With Ajax, web applications can send data to and retrieve from a server asynchronously (in the background) without interfering with the display and behavior of the existing page. By decoupling the data interchange layer from the presentation layer, Ajax allows for web pages, and by extension web applications, to change content dynamically without the need to reload the entire page. Despite the name, the use of XML is not required (JSON is often used in the AJAJ variant), and the requests do not need to be asynchronous.
(ii)
'Synchronisation' in telecommunication means that receiver signals whenever it is ready to receive messages, and only after this signal the transmitter will start transmitting. When the transmitter is done with the message, it will signal it has finished, so that receiver can now process the received message and do whatever it is supposed to be doing next.
This is of course a simplification and a very broad one, but it should give you the feeling of from where the meaning of '(a)synchronous' comes in JS.
So synchronous request in JS is actually synchronised with the main flow of the program. The program sends request to server ('I'm ready to receive') and waits for message. Message from the server will have a well defined end ('the message ends here - do your job'). When it is received, JS knows it can continue with execution of the program..
(iii) HTML, XML and JSON.
(c) HTML, DOM and JAvascript are available to be used in AJAX solutions. XHTML is obviously necessary for the displaying of information, while the DOM is necessary to change portions of an XHTML page without reloading it. The last part, javascript is necessary to initiate the client-server communication and manipulate the DOM to update the webpage. The other technologies in the list are helpful in fine-tuning an ajax solution, but they aren't necessary.
A number of commercial websites use ajax techniques to improve their user experience. These sites are really more like web applications than traditional brochureware websites that just display information because you visit it to accomplish a specific goal. Google sugggest and Gmail use ajax.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.