Ensurepass

QUESTION 21

Which of the following is a browser security issue that JavaScript developers should remember when developing a script?

A.JavaScript cannot be disabled in the client and will always run.

B.JavaScript functionality is immune to viruses, trojans and malware.

C.JavaScript is a cross-platform scripting language and will generate consistent results regardless of the client or server being used.

D.Certain JavaScript functionality may be blocked by some browsers, which prevents the script

from running as expected for all users.

 

Answer: D

 

 

QUESTION 22

Which statement will open this Web document in a new browser window?

A.document.open(http://www.CIWcertified.com);

B.window.open(http://www.CIWcertified.com);

C.window.open("http://www.CIWcertified.com");

D.document.open("http://www.CIWcertified.com");

 

Answer: C

 

 

QUESTION 23

Consider the following message displayed in a pop-up window: Welcome to the CIW Web site! Which line of code will deliver the pop-up window that displays this message?

A.<a href="http://www.CIWcertified.com" onclick()="alert(‘Welcome to the CIW Web site!’)">CIW Web site</a>

B.<a href="http://www.CIWcertified.com" onclick="alert(‘Welcome to the CIW Web site!’)">CIW Web site</a>

C.<a onclick="http://www.CIWcertified.com","CIW Web site", (‘Welcome to the CIW Web site!’)" />

D.<a onclick()="http://www.CIWcertified.com","CIW Web site", (‘Welcome to the CIW Web site!’)"

/>

 

Answer: B

 

 

QUESTION 24

You want to display a series of elements. Which choice demonstrates the correct syntax for an array in JavaScript?

A.var myArray = Array(1,2,3,4,5) for (var i = 0; i < myArray.[i]; i++ ){

document.write( myArray[i] + "<br />" );

B.var myArray = new Array(1,2,3,4,5) for (var i = 0; i < myArray.length ; i++ ){ document.write( myArray[i] + "<br />" );

C.var myArray = new Array(1,2,3,4,5) for (var i = 1; i < myArray.length; i– ){

document.write( myArray.length + "<br />" );

D.var myArray = Array(1,2,3,4,5) for (var i = 1; i < myArray.[i] ; i– ){

document.write( myArray[i] + "<br />" );

 

Answer: B

 

 

QUESTION 25

When used in conjunction with SQL, a server-side language (such as PHP) and a database (such as mySQL), AJAX can perform which of the following database operations?

A.Update the database schema and table relationships

B.Create custom database views and stored procedures

C.Modify database security permissions, including changing the database owner

D.Retrieve information from a database and display it back to the page originating the request

 

Answer: D

 

 

QUESTION 26

You want to add a personalized interaction with your users when they enter your Web site. To do this, you can display a JavaScript prompt on the home page that asks the user to enter her name. When the user enters text and clicks the OK button, an alert dialog box will appear and display the text "Welcome, name" (where name is the text entered by the user). Which choice shows the correct JavaScript code for this action?

A.alert("Welcome, " + prompt("What is your name?", ""));

B.alert("Welcome, ") + prompt("What is your name?", "");

C.prompt("What is your name?", "") + alert("Welcome, ");

D.prompt("What is your name?", "" + alert("Welcome, "));

 

Answer: A

 

 

QUESTION 27

In an X/HTML form, which script block will retrieve an input value and display it back without errors or warnings?

A.<script type="text/javascript"> function ShowEntry() {

var inp = document.getElementById("i"); var s = inp.value;

B.value = s; }

</script>

<input id="i" onchange="ShowEntry()" /><br /> You entered: <span id="d"></span>

C.<script type="text/javascript"> function ShowEntry() { document.getElementById("i"); var s = i.innerHTML;

document.getElementsByName("d").innerHTML = s; }

</script>

<input id="i" onchange="ShowEntry()" /><br /> You entered: <span id="d"></span>

D.<script type="text/javascript"> function ShowEntry() {

var inp = document.getElementById("i"); var s = inp.value;

document.getElementsbyName("d").innerHTML = s; }

</script>

<input id="inp" onchange="ShowEntry()" /><br /> You entered: <span id="d"></span>

5. <script type="text/javascript"> function ShowEntry() {

var inp = document.getElementById("i"); var s = inp.value;

document.getElementById("d").innerHTML = s; }

</script>

<input id="i" onchange="ShowEntry()" /><br /> You entered: <span id="d"></span>

 

Answer: D

 

 

QUESTION 28

Which statement will return the name of the browser being used to view the script?

A.navigator.appName

B.navigator.platform

C.navigator.userAgent

D.navigator.appVersion

 

Answer: A

 

 

QUESTION 29

Which choice demonstrates the correct syntax for declaring a variable?

A.var last name;

B.var &lastname;

C.var "lastname";

D.var lastName;

 

Answer: D

 

 

QUESTION 30

Consider the following code:

clip_image001

What will this alert display?

A.It is currently dark in the room

B.It is currently bright in the room

C.It is currently in the room

D.It is currently bright : dark in the room

 

Answer: A

 

 

Comments are closed.