ExamVeda
Login
Home
51
What are the two parts of JavaScript libraries?
Discuss
Answer & Solution
Answer: Option B
Solution:
All JavaScript libraries consists of two parts:
1. The external JavaScript itself, which is simply a text file with the containing JavaScript code, saved as a .js file.
2. A “script” tag referencing the external JavaScript file and defined on the page(s) that uses the library.
52
Which of the following is added to prefs.js when the console is automatically opened during JavaScript error?
Discuss
Answer & Solution
Answer: Option A
Solution:
is added to prefs.js when the console is automatically opened during JavaScript error.
53
Which of the following is possible to be referenced in external JavaScript?
Discuss
Answer & Solution
Answer: Option C
Solution:
One of the lesser known sides of external JavaScript is the ability to reference a PHP file instead of the familiar .js file.
54
Which of the following attribute takes the source of the PHP file?
Discuss
Answer & Solution
Answer: Option B
Solution:
The syntax to referencing a PHP file using external JavaScript is consistent enough with what we already know:
<script type="text/javascript" src="myscript.php">
55
What kind of path can the PHP file be?
Discuss
Answer & Solution
Answer: Option C
Solution:
The PHP file is either an absolute or relative path to a PHP script instead of the usual .js file.
56
Which of the following global variables is used to get parameters?
Discuss
Answer & Solution
Answer: Option D
Solution:
The global variable $HTTP_GET_VARS[] is used to get parameters.
57
What is the purpose of the RegExp method test()?
Discuss
Answer & Solution
Answer: Option B
Solution:
The RegExp method test() tests for a match in its string parameter.
58
What is the purpose of the function parameter filetype?
Discuss
Answer & Solution
Answer: Option A
Solution:
The function parameter “filetype” lets you tell the script what file type to expect before loading.
59
Which of the following is the method used to add an element to the desired location?
Discuss
Answer & Solution
Answer: Option C
Solution:
The method element.appendChild() is used to add the element to the desired location within the document tree.
60
Which program code doesn’t need preprocessing before being run?
Discuss
Answer & Solution
Answer: Option B
Solution:
A script is program code that doesn’t need pre-processing (e.g. compiling) before being run.