Caching And Debugging - Study Mode

[#1] What are the two parts of JavaScript libraries?
Correct Answer

(B) External JavaScript and the “script” tag

Explanation

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.

[#2] Which of the following is possible to be referenced in external JavaScript?
Correct Answer

(C) php

Explanation

Solution: One of the lesser known sides of external JavaScript is the ability to reference a PHP file instead of the familiar .js file.

[#3] Which of the following attribute takes the source of the PHP file?
Correct Answer

(B) src

Explanation

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">

[#4] What kind of path can the PHP file be?
Correct Answer

(C) Either Absolute or Relative

Explanation

Solution: The PHP file is either an absolute or relative path to a PHP script instead of the usual .js file.

[#5] Which of the following global variables is used to get parameters?
Correct Answer

(D) $HTTP_GET_VARS[]

Explanation

Solution: The global variable $HTTP_GET_VARS[] is used to get parameters.