When you build an application with coding and testing you s

When you build an application with _____________________ coding and testing, you start with a small portion of code and then build on that base by adding an operation or two at a time.

To find out how many characters there are in a string, you can use the __________________ property of the String object.

When ____________________ mode is used, an error is thrown when the JavaScript code tries to use an undeclared variable.

To check whether the HTML for an application has any errors, you can _____________________ the web page.

One way to display the source code for a page that’s displayed in a browser is to ____________________ on the page and then select a command like Source or View Source.

When you use JavaScript to change the ____________________________ for a web page, the web page is immediately updated to reflect those changes.

The toFixed method of a Number object returns a/an __________________________ that contains the value of the object rounded to the number of decimal places in the parameter.

Prior to ECMAScript 5, forgetting to declare a variable before using it in a JavaScript statement often caused debugging problems. That’s because an undeclared variable was treated as a _____________________ variable.

A __________________ error violates the rules for how JavaScript statements must be written.

In the code that follows, document is a/an ____________________________.
document.getElementById(\"emailAddress\");

The _______________________ event occurs when the focus leaves a control.

For a select list, you can use the value property to get the value of the _______________ option.

When you call a function, you may have to pass one or more _________________________ to it.

Code example 4-1

var add = function( x, y ) {
    return ( x + y );
}
alert( add (5, 3) );

(Refer to code example 4-1) The alert method in this example

displays a dialog box with a value of “8”.

displays a dialog box with a value of “x + y”.

does not display a dialog box.

displays a dialog box with a value of “5, 3”.

How can you clear a check from a Checkbox object?

set its checked property to false

set its value property to an empty string

call its blur method

set its clear property to true

For the following code, an event handler named investment_change is
var investment_change = function() {
    var years = parseInt( $(\"years\").value );
    alert(\"Years: \" + years);
}

window.onload = function() {
    $(\"investment\").onchange = investment_change;

}

attached to the onchange event of the global window object.

attached to the onload event of a control with an id of “investment”.

attached to the onchange event of a control with an id of “investment”.

attached to the onload event of the global window object.

What does the code that follows do?
$(\"email\").firstChild.nodeValue = \"Entry is invalid.\";

Sets the text for the first child of the element with “email” as its id attribute.

Gets the text for the element with “email” as its id attribute.

Sets the text for the element with “email” as its id attribute.

Sets the text for the next child of the element with “email” as its id attribute.

Sometimes, validating the HTML code for a web page will help you debug an application, because

the page won’t run in a browser if it isn’t valid

validation will catch some JavaScript errors

a trivial HTML error can cause other types of errors

you can be sure that a validated page will work correctly in a browser

To remove the focus from a control, what method do you use?

the remove method

the value method

the blur method

the focus method

a.

displays a dialog box with a value of “8”.

b.

displays a dialog box with a value of “x + y”.

c.

does not display a dialog box.

d.

displays a dialog box with a value of “5, 3”.

Solution

=>When strict mode is used, an error is thrown when the JavaScript code tries to use an undeclared variable.

=>to check whether the HTML for an application has any errors, you can validate(here html code compare with validation program with the rules of the doctype) the web page

=>A syntax error violates the rules for how JavaScript statements must be written

=>For a select list, you can use the value property to get the value of the selected option or (first selected option in a multiple type select box).

=>To remove the focus from a control, what method do you use?
blur() method

When you build an application with _____________________ coding and testing, you start with a small portion of code and then build on that base by adding an ope
When you build an application with _____________________ coding and testing, you start with a small portion of code and then build on that base by adding an ope
When you build an application with _____________________ coding and testing, you start with a small portion of code and then build on that base by adding an ope

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site