Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Number: 000-000
Passing Score: 800
Time Limit: 120 min
File Version: 1.0
http://www.gratisexam.com/
CIW 1D0-635
Practice Test
Version: 4.0
CIW 1D0-635: Practice Exam
Exam A
QUESTION 1
Assuming the function <body onload="DisplayName()"> is called, which script block will display Hello Joe in the
document window after you enter the name Joe?
A. <script type="text/javascript">
function DisplayName(void){
var YourName = window.prompt("What is your name?","Please enter your name"); document.write("Hello "
+ YourName);
}
</script>
B. <script type="text/javascript">
function DisplayName(){
var YourName = window.prompt("What is your name?","Please enter your name"); document.write("Hello "
+ YourName);
}
</script>
C. <script type="text/javascript">
function DisplayName(void){
var YourName = document.prompt("What is your name?",Please enter your name); document.write("Hello "
+ YourName);
}
</script>
D. <script type="text/javascript">
function DisplayName(){
var YourName = document.prompt("What is your name?","Please enter your name"); document.write("Hello
" + yourname);
}
</script>
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 2
Consider the following code fragment, which sets up the retrieval of an XML document named fish.xml and
calls a function named showFish(): var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", "fish.xml", true);
xmlhttp.onreadystatechange = showFish(); xmlhttp.send(); Which line of code initializes the XMLHttpRequest
object?
A. xmlhttp.send();
B. var xmlhttp = new XMLHttpRequest();
C. xmlhttp.open("GET", "fish.xml", true);
"Pass Any Exam. Any Time." - www.actualtests.com 2
CIW 1D0-635: Practice Exam
D. xmlhttp.onreadystatechange = showFish();
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 3
Which of the following demonstrate the correct syntax for the switch statement?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 4
Consider the following code: <script type="text/javascript"> var v1 = "alpha"; function f () { var v2 = "bravo"; alert
(v1 + ", " + v2); } f(); v1="charlie"; alert (v1 + ", " + v2); </script> What is the expected result when you run this
script in the browser?
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 5
Which of the following is a valid variable name in JavaScript?
A. this
B. that
C. 2that
D. 2this
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 6
What basic code is needed to define a function in JavaScript?
A. function myFunction { }
B. define myFunction() { }
C. function myFunction() { }
D. define myFunction { return value; }
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 7
When using AJAX, what is the purpose of the XMLHttpRequest object?
http://www.gratisexam.com/
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 8
Which statement will correctly call a JavaScript function without error?
A. var myFunction()
B. initiate myFunction()
C. call myFunction()
D. myFunction()
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 9
Consider only the following code:
Which of the following would properly supply the sum of the two numbers?
A. return sum;
B. mySum (num1+num2);
C. return num1+num2;
D. return sum(num1+num2);
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 10
Which is the best technique to test a script for cross-browser compatibility?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 11
Consider the following code:
A. There will be no visible output, but the script will count down to 0.
B. The script will output a countdown from 15 to 0 in the client window.
C. The script will output a countdown from 15 to 1 in the client window.
D. The script will output 15, then 1, because it will only write the first and last values of a while? statement.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 12
Consider the following code:
Which statement could be used to determine the value of the first radio button?
A. document.rdoGroup1.value
B. document.myForm.rdoGroup1[0].value
C. document.getElementById(rdoGroup1).value
D. document.getElementById("rdoGroup1").value
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 13
Which choice best defines events and event handlers?
A. An event can be an action initiated by the user, and an event handler specifies how JavaScript will react to
the action.
B. An event is an action initiated by the operating system, and an event handler is a function defined by the
user.
"Pass Any Exam. Any Time." - www.actualtests.com 7
CIW 1D0-635: Practice Exam
C. An event handler can be an action initiated by the user, and an event specifies how JavaScript will react to
the action.
D. An event is initiated by an error in JavaScript, and an event handler will attempt to bypass the error and
continue.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 14
Consider the following code:
What is the output when you run this script in the browser?
A. An alert box displaying the following: John, Paul, George, Ringo
B. An alert box displaying the following: Ringo, John, Paul, George
C. An alert box displaying the following: Ringo, Paul, George
D. An alert box displaying the following: John, Ringo, George
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 15
Which statement about the JavaScript form object is true?
A. The JavaScript form object has no relationship to the X/HTML <form> element.
B. You can use a single instance of the form object to represent multiple forms on a Web page.
C. The form object cannot be used to access the individual field elements that compose the form.
D. The JavaScript form object is available when the X/HTML <form></form> tags are present in the X/HTML
document.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 16
Consider the following code:
A. When you leave the page, the alert box will display.
B. The page will ignore the function, so a blank page will display on entry and exit.
C. When you enter the page, you will be warned that there is unfinished JavaScript to run.
D. When you leave the page, there will be a JavaScript error because you cannot unload an alert box.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 17
Which of the following comparison statements will return true?
A. x = 10;
y = 5;
x <= y;
B. x = 10;
y = 5;
x !== "X"
C. x = 10;
y = 5;
x === y;
"Pass Any Exam. Any Time." - www.actualtests.com 9
CIW 1D0-635: Practice Exam
D. x = 10;
y = 5;
x == y;
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 18
Which statement is true about the getElementByID() method?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 19
Consider the following code:
Will this function generate an error?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 20
Which script block will display Hello World in the browser when the script is run?
A. <script type="text/javascript">
var message = "Hello ";
var message2 = "World";
document.write(message + message2);
</script>
B. <script type="text/javascript">
var message = "Hello ";
var message2 = "World";
document.write(message & message2);
</script>
C. <script type="text/javascript">
var message = Hello ;
var message2 = World ;
document.write(message + message2);
</script>
D. <script type="text/javascript">
var message = "Hello ";
var message2 = "World";
document.write("message + message2 ");
</script>
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 21
Which of the following is a browser security issue that JavaScript developers should remember when
developing a script?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
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");
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
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?
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 24
You want to display a series of elements. Which choice demonstrates the correct syntax for an array in
JavaScript?
"Pass Any Exam. Any Time." - www.actualtests.com 12
CIW 1D0-635: Practice Exam
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
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?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
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?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
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>
E. <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>
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
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
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 29
Which choice demonstrates the correct syntax for declaring a variable?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 30
Consider the following code:
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Exam B
QUESTION 1
Consider the following code:
What is the expected result when you run this script in the browser?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 2
Consider the following code:
What is the appropriate parameter for the alert() method in line 5 to reference the text in the firstName text
box?
A. document.myForm.value(firstName)
B. document.myForm.firstName.value
"Pass Any Exam. Any Time." - www.actualtests.com 16
CIW 1D0-635: Practice Exam
C. window.myForm.firstName.value
D. window.myForm.text(firstName)
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 3
Consider the following code:
When an invalid e-mail address is entered, an alert is displayed to the user, but the form submission is not
interrupted. What changes need to be made to the script in order to abort the submission if an invalid e-mail
address is entered?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 4
Consider the following code:
A. "1, 2, 3, 4, 5, 6, 7, 8, 9"
B. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
C. 1, 2, 3, 4, 5, 6, 7, 8, 9,
D. "1, 2, 3, 4, 5, 6, 7, 8, 9, 10"
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 5
Suppose you define two variables as follows:
var x = 5;
var y = "5";
A. alert(x + int(y));
B. alert(x + parseInt(y));
C. alert(x + y);
D. alert((int)x + (int)y);
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 6
Consider the following code:
What is the expected result when you run this script in the browser?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 7
Consider the following statement:
for (X; Y; Z)
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 8
Which of the following is a practice associated with the security risk known as cross-site scripting (XSS)?
A. Inserting JavaScript code in a URL query string to perform an unintended or malicious action
B. Using a look-alike site to impersonate a trusted site so the user will enter sensitive information
C. Using a certificate authority validation to persuade users to accept a specialized script that can override
certain security restrictions in thebrowser
D. Launching a JavaScript statement that has no conditions for ending, thus requiring the user to close the
browser in order to end the script
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 9
What is the purpose of the prototype property in JavaScript?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 10
Which example correctly implements inline scripting with JavaScript?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 11
Consider the following code:
alert(myString.length);
What is the output when you run this script in the browser?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 12
Consider the following code:
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 13
Which of the following is a reason why a developer would use a JavaScript library?
A. JavaScript libraries ensure quality code that does not harbor security risks.
B. JavaScript libraries require a shorter learning curve than JavaScript.
C. JavaScript libraries are subsets of Java and thus provide more powerful code.
D. JavaScript libraries provide platform-independent code that will behave identically in any browser.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 14
Which of the following will correctly declare the EmployeeID variable as a string data type?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 15
Which of the following will correctly modify the value of an X/HTML element's attribute within the DOM?
A. getAttribute(NewValue, AttributeName)
B. getAttribute(AttributeName, NewValue)
C. setAttribute(NewValue, AttributeName)
D. setAttribute(AttributeName, NewValue)
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 16
Consider the following select list:
Which of the following will select the third option in the list?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 17
How is the alert() method different from prompt() and confirm()?
A. The alert() method generates a modal dialog box, which requires user action before the next JavaScript
instruction can be executed,whereas prompt() and confirm() do not.
B. The alert() method requires only one parameter, whereas prompt() and confirm() require two parameters.
C. The alert() method requires two parameters, whereas prompt() and confirm() require only one parameter.
D. The prompt() and confirm() methods return a value, whereas alert() does not.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 18
Maria, a 22-year old student, is testing her JavaScript application, which includes the following code:
Assuming Maria enters truthful information, what is the value of z after executing this code?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
http://www.gratisexam.com/
QUESTION 19
Consider the following code:
When a user clicks on the displayed link, which site will he navigate to?
A. www.msn.com
B. www.yahoo.com
C. www.google.com
D. No other site, because there is a runtime error
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 20
Consider the following code using a checkbox object:
A. checked
"Pass Any Exam. Any Time." - www.actualtests.com 24
CIW 1D0-635: Practice Exam
B. onclick()
C. checkThis
D. z-index
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 21
Jane has created a file with commonly used JavaScript functions and saved it as "allFunctions.js" in the
application's root directory. She wants to load this file into a Web page to access its functions. Which statement
shows the correct syntax to do this?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 22
Consider the following code:
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
"Pass Any Exam. Any Time." - www.actualtests.com 25
CIW 1D0-635: Practice Exam
Explanation:
QUESTION 23
Consider the following declaration of a custom object:
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 24
Consider the following code:
What is the expected output when you run this script in a browser?
A. A button labeled Click Me will appear, with an input box that displays the following default text:
Old Value. Upon clicking the button, the textin the text box will change to New Value. Upon clicking the
button again, the text in the text box will change back to Old Value.
B. A button labeled Click Me will appear, with an input box that displays the following default text:
Old Value. Upon clicking the button, the text inthe text box will change to New Value. Upon clicking the
button again, the text in the text box will change to Old Value, New Value.
C. A button labeled Click Me will appear, with an input box that displays the following default text:
Old Value. Upon clicking the button, the text inthe text box will change to New Value. Upon clicking the
button again, you will see nothing change.
"Pass Any Exam. Any Time." - www.actualtests.com 26
CIW 1D0-635: Practice Exam
D. This script will not run. You will get an error because the value="Old Value" statement in the <input> tag
contains the reserved wordValue within the quotes.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 25
You are developing a Web page for your company's site, and you plan to use a library plug-in from the jQuery
library. Which choice describes the proper steps for using the plug-in?
A. After locating the plug-in that you want to use, you then copy the code from the jQuery site and paste it into
your CSS file using the <script>tag.
B. After locating the plug-in that you want to use, you then download the EXE file and install it on your browser.
The plug-in will take effect afteryou restart the browser.
C. After locating the plug-in that you want to use, you download the plug-in, compile the code and upload it to
your server, then you reference thecompiled code with a <script> tag in your X/HTML file.
D. After locating the plug-in you want to use, you add to your X/HTML file a <script> tag referencing the jQuery
library and a <script> tagreferencing the external plug-in file.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation: