Web Science/Part1: Foundations of the web/Dynamic Web Content/Ajax and the XMLHttpRequest class/quiz

From Wikiversity
Jump to navigation Jump to search

1 What is true about using JavaScript for issuing an HTTP request from some webpage?

Usually only HTTP requests to the domain from which the webpage that contains the calling JavaScript was downloaded are possible
It is possible to make HTTP requests to other servers if they run on port 433
It is possible to make HTTP requests to other servers if they have a cross origin resource sharing policy
It is possible if the domain from which the webpage that contains the calling JavaScript was downloaded is white listed in the Access-Origin Header field of the server response.
If not allowed the browser will prevent JavaScript from making the HTTP request.
the repsonse has to be in JSON (JavaScript object notation)

2 Why is JavaScript useful for the World Wide Web?

It enables more interactive websites
It can take loads of traffic from the web server or the web server's backend
It can help websites to better communicate with search engines and provide metadata like RDFa
Without JavaScript, the structure of web content could not be completely seperated from layout and formatting
It can help to easily make asynchronous HTTP requests to a web server

3 What are the advantages of JavaScript libraries?

They provide an API that will work on almost any browser
They make JavaScript more powerful

4 Which of the following are JavaScript libraries

jQuery
PHP
Java
mootools
Prototype
Netscape