JAVASCRIPT CERTIFICATION TEST
Which of the following escape sequences will print the backslash character? - Answers -
\\
Which of the following characters matches the start of a line in a regular expression -
Answers - ^
What is the main role of JavaScript in an AJAX transaction? - Answers - To request XML
or plain text data from a web server
Which property is used to add CSS styles to elements in a Web Page? - Answers -
HTMLElement.style
What is a bug in the JavaScript code? - Answers - An error in the code
Which of the following is not a valid property? - Answers - coords.timestamp
What readyState value specifies that the response header has been received, but the
message body is yet to be received? - Answers - 3
Which of the following casting rules is incorrect when concatenating? (true is a Boolean
value) - Answers - 9 + true equals "9true"
Which of the following statements is true of semicolons in JavaScript? - Answers -
Semicolons are essential while combining separate statements in a line
Which statement is false in reference of XSS attacks? - Answers - They cannot be
performed through emails or mail clients
Sarah has created a JavaScript library, and now she wants to include it in her
document. Which of the following statements follows the correct syntax to link the library
in her document? - Answers - <script type="text/javascript" src="library.js"></script>
Which of the following information is not a part of the cookie header? - Answers -
expires = date
Which of the following is not true of JavaScript plug-in? - Answers - Plug-ins cannot be
used without the library they depend upon; Every pre-made script is a library
How can a cookie be deleted using JavaScript? - Answers - By setting a passed
expiration date
Which event is triggered on the <select> element when the selection is modified? -
Answers - onchange
, Which of the following methods will remove all the data from the storage? - Answers -
localStorage.clear();
Which of the following initializes the HTTP request in an AJAX transaction? - Answers -
The open() method
What is a named memory block that serves as containers for a value called? - Answers
- Operator
Variable
Which of the following solutions will not help in preventing XSS attacks? - Answers -
Storing login credentials in cookies for security
Which of the following characters is used as the escape character in JavaScript? -
Answers - \
Which of the following statements is not true of the XMLHttpRequest object? - Answers
- It transfers the data between a client and server
Which of the following statements is not true of the window object? - Answers - It is
subordinate to the navigator object
Which method of the history object is used to create a new history entry - Answers -
pushState()
Which of the following objects is used to get information about the user's browser -
Answers - navigator
Which of the following is a major advantage of using the appendChild() Method? -
Answers - It can be used to add elements to the DOM without overwriting the existing
page
Which programming language is typically used in AJAX transactions to query
databases? - Answers - SQL
Which of the following is true when using AJAX with databases? - Answers - AJAX can
perform all back-end database operations
Which of the following input types masks the value entered by users? - Answers -
password
A user enters confidential data on a web site while performing a task. This data was
redisplayed on the Web page, after the task was completed. The data sent between the
server and browser was not encoded as HTML entities. Which of the following
vulnerabilities will this result? - Answers - Non-persistent XSS
Which of the following escape sequences will print the backslash character? - Answers -
\\
Which of the following characters matches the start of a line in a regular expression -
Answers - ^
What is the main role of JavaScript in an AJAX transaction? - Answers - To request XML
or plain text data from a web server
Which property is used to add CSS styles to elements in a Web Page? - Answers -
HTMLElement.style
What is a bug in the JavaScript code? - Answers - An error in the code
Which of the following is not a valid property? - Answers - coords.timestamp
What readyState value specifies that the response header has been received, but the
message body is yet to be received? - Answers - 3
Which of the following casting rules is incorrect when concatenating? (true is a Boolean
value) - Answers - 9 + true equals "9true"
Which of the following statements is true of semicolons in JavaScript? - Answers -
Semicolons are essential while combining separate statements in a line
Which statement is false in reference of XSS attacks? - Answers - They cannot be
performed through emails or mail clients
Sarah has created a JavaScript library, and now she wants to include it in her
document. Which of the following statements follows the correct syntax to link the library
in her document? - Answers - <script type="text/javascript" src="library.js"></script>
Which of the following information is not a part of the cookie header? - Answers -
expires = date
Which of the following is not true of JavaScript plug-in? - Answers - Plug-ins cannot be
used without the library they depend upon; Every pre-made script is a library
How can a cookie be deleted using JavaScript? - Answers - By setting a passed
expiration date
Which event is triggered on the <select> element when the selection is modified? -
Answers - onchange
, Which of the following methods will remove all the data from the storage? - Answers -
localStorage.clear();
Which of the following initializes the HTTP request in an AJAX transaction? - Answers -
The open() method
What is a named memory block that serves as containers for a value called? - Answers
- Operator
Variable
Which of the following solutions will not help in preventing XSS attacks? - Answers -
Storing login credentials in cookies for security
Which of the following characters is used as the escape character in JavaScript? -
Answers - \
Which of the following statements is not true of the XMLHttpRequest object? - Answers
- It transfers the data between a client and server
Which of the following statements is not true of the window object? - Answers - It is
subordinate to the navigator object
Which method of the history object is used to create a new history entry - Answers -
pushState()
Which of the following objects is used to get information about the user's browser -
Answers - navigator
Which of the following is a major advantage of using the appendChild() Method? -
Answers - It can be used to add elements to the DOM without overwriting the existing
page
Which programming language is typically used in AJAX transactions to query
databases? - Answers - SQL
Which of the following is true when using AJAX with databases? - Answers - AJAX can
perform all back-end database operations
Which of the following input types masks the value entered by users? - Answers -
password
A user enters confidential data on a web site while performing a task. This data was
redisplayed on the Web page, after the task was completed. The data sent between the
server and browser was not encoded as HTML entities. Which of the following
vulnerabilities will this result? - Answers - Non-persistent XSS