Document Object Model And Event Handling - Study Mode

[#111] Which of the following is a boolean cookie attribute?
Correct Answer

(B) secure

Explanation

Solution: The final cookie attribute is a boolean attribute named secure that specifies how cookie values are transmitted over the network. By default, cookies are insecure, which means that they are transmitted over a normal, insecure HTTP connection. If a cookie is marked secure, however, it is transmitted only when the browser and server are connected via HTTPS or another secure protocol.

[#112] Which of the following function is used as a consequence of not including semicolons, commas or whitespace in the Cookie value?
Correct Answer

(A) encodeURIComponent()

Explanation

Solution: Cookie values cannot include semicolons, commas, or whitespace. For this reason, you may want to use the core JavaScript global function encodeURIComponent() to encode the value before storing it in the cookie.

[#113] What is the constraint on the data per cookie?
Correct Answer

(C) 4 KB

Explanation

Solution: Each cookie can hold upto only 4 KB. In practice, browsers allow many more than 300 cookies total, but the 4 KB size limit may still be enforced by some.

[#114] The Client-Side Databases are stored in the
Correct Answer

(B) User’s computer

Explanation

Solution: The actual client-side databases are stored on the user’s computer and are directly accessed by JavaScript code in the browser.

[#115] Which of the following use the Web SQL Database?
Correct Answer

(A) Chrome

Explanation

Solution: Chrome, Safari, and Opera implemented the Web SQL Database API, but Firefox and IE have not, and likely never will.