代写代考 Computer Science 571 2nd Exam Prof. , December 2, 2014, 5:30pm – 6:50pm

Computer Science 571 2nd Exam Prof. , December 2, 2014, 5:30pm – 6:50pm
Name: Student ID Number:
1. This is a closed book exam.
2. Please answer all questions on the test

Copyright By PowCoder代写 加微信 powcoder

REST Questions [10 pts]
Each question is worth 2 points.
Q1: What are the 3 fundamental aspects of REST design patters?
Q2: What are the 4 simple operations of REST? A2:
Q3: What is the typical representation of resources in REST? A3:
Q4: What is the major reason of the gain in popularity of REST versus other approaches?
[ ] is Platform independent
[ ] is Language Independent
[ ] is based on the HTTP standard [ ] is able to run behind firewalls
[ ] is a W3C recommendation
[ ] is based on cookies
[ ] does not offer built-in security [ ] ALL OF THE ABOVE

Web Performance Questions [10 pts]
Questions 1-5 are worth 1 point each.
Q1: Where should you put style sheets and why to optimize performance?
Q2: Where should you put scripts and why to optimize performance? A2:
Q3: Should you “inline” JavaScript code or use external files and why to optimize performance?
Q4: Should you scale images or not, and why? A3:
Q5: What are the two rules that minimize the transfer of information between server and browser?
Q6. List any 5 recent rules (not the initial 14 rules) for faster Web pages from Yahoo‘s YSlow
that help speed up web performance. This question is worth 5 points. A6:

HTML5 Questions [10 pts] Each question is worth 2 points.
Q1: In HTML5 is it possible to perform “document editing” just using HTML elements and attributes?
Q2: Which of the following capabilities have included in HTML5?
[ ] canvas
[ ] video and audio
[ ] local SQL database
[ ] geolocation
[ ] CSS 2D/3D transformations [ ] flash plugin
[ ] ALL OF THE ABOVE
Q3: Why have FRAMES been removed from HTML5? A3:
Q4: What happened to the “align” attribute used on caption, iframe, img, input, and many other elements in HTML4?
Q5: Consider the following HTML5:

What is the purpose of the “id” attribute? A5:

JSON /AJAX Questions [10 pts]
Each is worth 1 point.
Q1: Of the URLs below, which have the same origin?
a. http://www.ajaxbook.com
b. http://www.ajaxbook.com:8443 c. https://www.ajaxbook.com
d. http://ajaxbook.com
e. http://carsearch.ajaxbook.com
Q2: Creating an instance of the XMLHttpRequest object is the same in all browsers
a. True b. False
Q3: Which XMLHttpRequest method actually makes the request?
a. getAllResponseHeaders() b. makeRequest()
Q4: What MIME type must be set when using XMLHttpRequest to send a POST request of a form?
a. application/octet-stream
b. Application/xhtml+xml
c. application/x-www-form-urlencoded
Q5: Which of the following MIME types will cause the web browser to automatically parse an XML response?
a. text/xml
b. text/javascript c. text/plain
d. text/html

Q6: Which JavaScript method is used primarily with JSON?
a. eval() b. test() c. run() d. exec()
Q7: Which field of XMLHttpRequest will be populated with a JSON response?
a. responseXML b. responseText c. response
d. statusText
Q8: Which of the following is not valid JSON?
a. { “name”: “Bob” }
b. { “user”: { “ name”: “Bob” } }
c. { “name”: “Bob”, “getName”: function() { return this.name } }
Q9: The XMLHttpRequest object can be used to upload a file.
a. True b. False
Q10: The web browser displays a visual progress indicator while an XMLHttpRequest is being processed.
a. True b. False

JavaScript and Ajax Questions [10 pts]
Below is the HTML source code that produces the web page above. There is one edit box, and when each character is typed, a list appears that shows the “suggested” valid answers, obtained from the XML file us-states.xml.

My Fifth Ajax Script

Please enter your state:

Below is the JavaScript source code, script05.js, that was imported into the HTML above, but some of the lines are missing, replaced by XXXXXXXs. Fill in the missing.

window.onload = initAll;
var xhr = false;
var statesArray = new Array();
function initAll() { document.getElementById(“searchField”).XXXXXXX = XXXXXXX;
if (window.XMLHttpRequest) {
xhr = new XMLHttpRequest();
if (xhr) {
xhr.onreadystatechange = XXXXXXX;
xhr.open(“GET”, “us-states.xml”, true);
xhr.send(null); }
alert(“Sorry, but I couldn’t create an XMLHttpRequest”);
function setStatesArray() {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
if (xhr.responseXML) {
var allStates = xhr.responseXML.getElementsByTagName(“item”);
for (var i=0; i


Oregano’s Wood-Fired Pizza

4546 Real, #A6
Los Altos
CA
(650) 941-3600 37.401434 -122.114407
4.5 11 11
1326963606 This place is great.

1.19
http://local.yahoo.com/info-21300761- oregano-s-woodfired-pizza-los-altos

When the “output=json”, a JSON response is returned. Please fill in the missing code:
{“ResultSet”: {“Result”:
{“id”:”21300761″,

JQuery Questions [10 pts]
Q1 (2 pts): What is the JavaScript object added by jQuery? A1:
Q2 (2 pts): What commonly used JavaScript objects are abstracted by jQuery?
[ ] XMLHttpRequest
[ ] ALL OF THE ABOVE
Q3 (6 pts): [This question is worth 6 points] Consider the following example without JQuery:


A3: Rewrite it using JQuery.

Responsive Website Design Questions [20 pts]
Each question is worth 4 points.
Q1: A site designed with RWD adapts the layout to the viewing environment by using 3 things. What are they?
A1: (1) (2) (3)
Q2: List 3 “usability” guidelines for Websites on mobile devices?
A2: (1) (2) (3)
Q3: What is the main difference between “adaptive” and “fluid” grids? A3:
Q4: In RWD, how do you avoid having an image deformed due to screen size? A4:
Q5: Bootstrap comes with 3 components, each store in its own folder. What are these components?

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com