BIT 4444 Final Exam
What is the value of b after executing the following code? var a = 8 var b = "2" + 8
"28"
What declares a variable in PHP?
$
What event handlers can correctly handle a click event on an element with an id value="starter"?
$("#starter").click(function(){...})
Which of the following jQuery methods is used to initiate an asynchronous web request?
$.ajax()
Which PHP system variable is initialized when a HTTP POST request is sent to the web server?
$_POST
What method will load the same PHP code page when the user clicks the Submit button?
$_SERVER['PHP_SELF'];
What XPath expression selects nodes no matter where they are in the XML doc?
//
What does an ordered list look like in HTML?
1. item 1 2. item 2 3. item 3
What is the IP address of the loopback address, localhost?
127.0.0.1
What is the value of b after executing the following code? var a = 8; var b = ++a;
9
The first line of code in an html document is ____________.
<!doctype html>
In HTML, what tag is used to indicate a hyper link?
<a>
The HTML element used to specify JavaScript code is:
<script>
In HTML, what tag is used to indicate a table header?
<th>
Ajax stands for:
Asynchoronous JavaScript and XML
Elements that have lower z-index property values are displayed ______ elements with higher z-index values.
Behind
Format of a delete statement:
DELETE FROM table WHERE criteria
XMl stands for?
Extensible Markup Language
Which CSS style specification method achieves the best separation of content and presentation?
External style sheets
T/F In JavaScript, a variable cannot be used to reference a function.
FALSE
T/F A JavaScript variable name can have a space in it.
False
T/F Both JavaScript and Java can access local files.
False
T/F Child elements do not inherit styles from parent elements.
False
T/F Data in hidden values will not be sent to the action URL when the form is posted (submitted).
False
T/F In HTML, an image cannot be used as a link.
False
T/F JavaScript can replace CSS because it can achieve more advanced functionalities.
False
T/F Radio input types should be used when more than one option can be selected.
False
T/F Rich Internet Applications (RIA) are desktop applications that approximate the performance and rich GUI of web applications.
False
T/F When a synchronous web request is being processed on the server, the user can still interact with the client web page.
False
T/F XML tags are case-insensitive
False
T/F You can define multiple head elements within an HTML5 page.
False
T/F The html <style> tag is used reference the jQuery library
False
Which technology is mostly used at the logic tier?
HTML
____________ docs are specified in the DOM
HTML and XML
PHP stands for:
Hypertext Preprocessing
Format of an insert statement:
INSERT INTO table(cols...) VALUES(vals....)
Which browsers support the CSS-webkit-extension?
IOS browser Chrome Safari
D3.js is a ________________________ for producing dynamic and interactive data visualizations.
JavaScript Library
jQuery is a:
JavaScript library
Complete the following SQL statement that lists all employees in the departments of 'Sal' and 'Mkt'. SELECT * FROM Employee WHERE dept_code='Sal' _______ dept_code='Mkt'
OR
What is a limitation for client-side scripting?
Placing large amounts of JavaScript on the client can cause security issues
MySQL is a:
RDBMS
What SQL statement will list employees whose last name is four letter and ends in 'e'?
SELECT * FROM Employee WHERE emp_lastname = '_ _ _e'
In the DOM, 2 nodes are __________ nodes when they have the same parent node.
Sibling
T/F D3.js can use CSS and jQuery selectors.
TRUE
T/F The D3.js Axis component allows for addition of a horizontal-axis and vertical-axis to any graph.
TRUE
The html code <meta charset="utf-8" /> is a/an ____________.
Tag
What input type allows multiple lines of text entry?
TextArea
T/F A figurecaption can be displayed over several images.
True
T/F A new session array, $_SESSION, must be initialized.
True
T/F Ajax applications run client-side user interaction and server communication in parallel.
True
T/F An Ajax application usually updates part of the web page after receiving a response from the server.
True
T/F An XML doc is well-formed is an XML parser can process the doc successfully
True
T/F DTDs and schemas are used to define element types, attributes, and their relationship.
True
T/F HTML code is case-sensitive.
True
T/F In JavaScript, a function can be defined within another function.
True
T/F In a 3-tier application architecture, the middle tier is located on a web server.
True
T/F JavaScript is case-sensitive.
True
T/F Specifying an element's position as absolute removes it from the normal flow of elements on the page.
True
T/F Styles defined by the author of an HTML document take precedence over styles defined by a user agent (e.g. browser).
True
T/F The <meta> element can be used to provide additional info for search engines to index.
True
T/F The HTML node in a DOM tree is the parent node of all HTML elements in the page.
True
T/F The Same Origin Policy prevents the XMLHttpRequest object from requesting resources from domains other than the one that serves the application.
True
T/F The XMLHttpRequest object is used to manage interaction with the server in Ajax applications.
True
T/F The summary element displays a right-pointing arrow next to a summary or caption.
True
T/F XML allows document authors to create their own element tags.
True
T/F jQuery can achieve what JavaScript can do with less coding.
True
T/F jQuery can completely seperate JavaScript from HTML
True
T/F During a cookie's lifespan, its data will be transmitted to the web server each time the user visits the website that the cookie belongs to.
True
Format of an update statement:
UPDATE table SET col = val WHERE criteria
In JavaScript, when we refer an array element, we use the array's name followed by the position index of the element in:
[ ]
In a CSS style rule, a pseudo class (e.g. hover) is preceded by:
a colon (:)
In the jQuery syntax, $(selector:filter).action() the $ represents:
a jQuery object
What event registration method can register more than one event handler for the load event?
addEventListener("load", start(), false)
In JavaScript, the window object's load event fires ________ all it's children elements are loaded and all external files are loaded.
after
The DOM provides scripting access to ______ on a web page
all elements
A jQuery $(":text") selects:
all form elements with type="text"
A jQuery $("p") selects:
all paragraph elements
A JavaScript function w/o a name is called:
anonymous function
Session data ____________________ after the user has left the website or closed the browser.
are deleted
A user is directed to page2.php after submitting form data from page1.php. The user then clicks a link on page2.php to return to page1.php. The submitted form data _______________________________.
are no longer available on page1.php
What sectioning element should be used to describe content that's separate such as a news article?
article
______ elements have a virtual box drawn around them.
block-level
The _____ command should be used to break a loop if the next command to be executed is the one that follows the loop.
break
In a switch statement, which statement must be used at the end of a case branch code segment?
break;
JavaScript is mainly used for:
client-side execution
HTML SVG element is a/an:
container element for SVG graphics
Two aspects of any document are:
content and style
What are 3 solutions to the data persistence problem?
cookie session databases
Which D3 method is used to open a JSON file?
d3.json()
What element is a block-level elements?
div
Given this html page: <html> ... <img id="myImage" src="oldpic.jpg"> ... </html> What statement can correctly access the <img> element's src attribute value?
document.getElementById("myImage").src
Which of the following is the correct syntax for modifying the content of this <p> element? <html> ... <p id="newp"> content to be modified </p> ... </html>
document.getElementById("newp").innerHTML = "new content"
What is the correct way to access the first <p>element in this html page? <html> ... <p> Monday </p> <p> Tuesday </p> <p> Wednesday </p> ... </html>
document.getElementByTagName("p")[0]
What animation property value specifies the amount of time each animation iteration takes?
duration
What input type has a self-validating capability?
Which CSS style can specify boldness of text?
font-weight
Which of the following is NOT a JavaScript object that provides a rich collections method? - form - math - array - string
form
Which of the following keyword is used to define a JavaScript function? - Function - Sub - function - sub
function
Which doc method returns a single element object?
getElementById()
What line of code would display a shadow to the right and the bottom sides of the h1 block-level element?
h1 {box-shadow: 25px 25px 50px grey;}
What are core features in jQuery?
handling events DOM element selection/manipulation creating animation
JSON is a data format good for storing:
hierarchical data
Which of the following PHP functions determines if a variable has a value and is not NULL?
isset()
What are valid DOM cellections?
links images forms
What does this code do? SELECT * FROM Employee WHERE emp_hiredate>='1997-01-01' AND emp_hiredate<='1997-12-31'
lists full details of employees who were hired in 1997
An HTTP cookie is a small piece of data stored ___________________.
locally in the user's browser
In a multi-tier app architecture, the ____ tier implements business logic/controller logic.
middle
When the user puts the mouse over an image element, the image's ______ event will fire.
mouseover
In an HTML page's DOM tree, a node can have ______ child node(s) and ______ parent node(s)
multiple, one
Which PHP function gets the number of affected DB records when executing an INSERT/UPDATE/DELETE statement?
mysqli_affected_rows()
What PHP method can get a row from the resultset of a SELECT statement and turn it into an arry?
mysqli_fetch_array
Which PHP methods converts a row from a SELECT result into s JSON object
mysqli_fetch_assoc()
In the following html DOM tree, the <h1> element is the ____________ of the <a> element. <html> element |-----<head> element | |-----<title> element | |-----<body> element |-----<a> element |-----<h1> element
nextSibling
In DOM, an element is a/an _______ and an attribute is a/an__________.
object, property
Session data are stored:
on the remote server
When PHP commands are processed _________ is sent by the web server to the clients browser.
only the output
Which of the following XMLHttpRequest properties stores a function to be called automatically each time the readystate property changes?
onreadystatechange
Which XMLHttpRequest methods is used to initialize an asynchronous web request?
open.('GET', dest.html', true)
The boxmodel means that the content is surrounded by _________, _________, and __________ (from closest to the content to the farthest).
padding, border, and margin
The ______ attribute allows you to place a temporary text in a text field.
placeholder
Which array method removes the last element in array and returns the removed element?
pop()
What does DISTINCT do?
returns only unique values
SVG stands for:
scalable vector graphics
XPath is a language of expressions used to:
search data in XML docs
What method is used to initialize the $_SESSION variable?
session_start()
What method is used to create a cookie?
setcookie()
What input type sends form data to a URL?
submit
Which CSS style can be used to center text in an element?
text-alignment
The top-level of the DOM is:
the document object
What does the CSS rule mean? nav ul{ display: block;}
the element will be displayed as a block-level element
What is the correct way to specify that a cookie expires in 2 days?
time()+60*60*24*2
How many percentages can you define in a keyframes rule?
unlimited
Which keyword in the html code, <meta charset="utf-8"> is an attribute name?
utf-8
What brackets are used to specify a CSS style rule?
{ }