Looking for COMPSCI2021 Web Application Development 2 - 2024-25 test answers and solutions? Browse our comprehensive collection of verified answers for COMPSCI2021 Web Application Development 2 - 2024-25 at moodle.gla.ac.uk.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Consider the following JavaScript code that conducts XML parsing
text = "<bookstore><book>" + "<title>Everyday Italian</title>" +
"<author>Giada De Laurentiis</author>" + "<year>2005</year>" +
"</book></bookstore>";
parser = new DOMParser();xmlDoc = parser.parseFromString(text,"text/xml");
var a = xmlDoc.getElementsByTagName("year")[0].nodeName;
What would the value of variable a be set to?When using HTTP, two communication methods are commonly used. Select the statement that best describes what each method does.
Which of the following statements best describes the differences between a DOM parser and a SAX parser?
Consider the XHTML code below.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Sample title</title>
<link type="text/css" rel="stylesheet" href="style.css"/>
</head>
<body> <p>
The displayable text</p> </body>
</html>
Is it well-formed?
Consider the following jQuery code applied to an HTML page:
$(document).ready( function() { $("p").on({mouseenter: function() {
$(this).css("background-color", "red"); },
mouseleave: function() {
$(this).css("background-color", "lightgreen"); },
click: function() {$(this).css("background-color", "yellow"); }
});
});
If the user clicks on a paragraph element and then doesn't move the mouse further, what will be the paragraph's background colour?
Consider the following script element existing midway through an HTML page that has jQuery imported:
<script> $(function() { $("button").click(function(){alert('remove p')}); });</script>
Which of the following statements best describes the results of this script?