Web Design 2 AHCS Chapter 5&6

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

Which statement most accurately describes the relationship between JavaScript and Java?

JavaScript and Java are unrelated.

Which of the following statements about JavaScript is true?

JavaScript is platform-independent.

Kwan is using JavaScript extensively to add interactivity to his Web site. Contained within his script is a counter object that calculates a date based on a number input by the user. Which term describes the calculation process that Kwan's counter object performs?

Method

Generally speaking, what functionality does JavaScript provide when used as part of the "Web development trifecta"?

Page manipulation capabilities and advanced interactivity

What makes a scripting language, such as JavaScript, different from a full programming language, such as C, C++ and Java?

Scripting languages are generally interpreted without the explicit compilation step that full programming languages need to run.

Sarah has written several JavaScript scripts for her Web site, but she realizes that implementing the scripts may be complicated by the fact that people may view her pages using different user agents and user agent versions. What should Sarah do to ensure that her scripts will run correctly without knowing what user agent a person will use to view her pages?

Test her scripts in the latest versions of popular browsers

Code errors can be repaired, once you are aware of them. What should you do first after you have written your script code, and placed it in (or attached it to) an HTML file?

Test the code by running your script in multiple browsers and browser versions to see if it works as intended.

In JavaScript, how do you combine text strings, such as combining the prompt() and alert() methods to request user input and then display it?

Use concatenation to link two or more text strings.

Question 22 : In JavaScript, which term describes a specific quality of a property?

Value

Which statement is true regarding capitalization and variable names in JavaScript?

Variable names can be written in lowercase or uppercase, but it is good coding practice to use consistent capitalization for all names.

How should you embed JavaScript code in an HTML5 document to which you are also linking an external JavaScript file?

You must use separate <script> statements to call the external file and embed a separate script.

JavaScript has some basic rules for naming variables. For example, the first character of the variable name must be:

a letter, the underscore ( _ ) character or the dollar sign ( $ ).

A JavaScript rule concerning variables states that the first character of a variable name must be:

a letter, the underscore character ( _ ) or the dollar sign ( $ ).

Which of the following is an example of a user-defined JavaScript function?

addSpace()

What step should you take to ensure that your JavaScript code runs as expected?

A Test your code in various browsers.

In JavaScript, what is a property?

A descriptive characteristic of an object that the developer specifies when creating the object

Consider the following JavaScript code: function helloWorld(){ myVar = "Hello World"; } helloWorld(); alert(myVar);

A dialog box that displays: Hello World

What is a variable in JavaScript?

A named space of memory that allows you to store a value

In JavaScript, what is an expression?

A part of a statement that is evaluated as a value

You want to be able to ask your site users for a password, then store the user's input so that the password can be used as needed to execute various functions within the application. In which of the following should the user's input be stored?

A variable

The Word Wide Web is based upon which programming model?

An event-driven model

Why is JavaScript relatively easy to learn?

Because JavaScript does not have all of the complex rules associated with full object-oriented languages

Why should you test your JavaScript code in multiple browsers?

Because JavaScript programs tend to be implemented differently in different browsers

What is the term for a script block that transfers program execution to a subroutine, procedure or another function?

Calling statement

Which of the following examples describes a syntax error?

Forgetting to close the curly braces that designate a block of code for execution

Question 14 : When you embed JavaScript within an HTML document, in what document sections can you add the script?

In the <head> and/or the <body> sections

Consider the following code: alert("Good morning, " + prompt("What is your name?", "") + "!");

It concatenates two methods to display a message, then request and capture user input.

Which of the following will correctly call a JavaScript function without error?

myFunction("a")

Which JavaScript event handler runs when a user closes a browser window?

onunload

Consider the following JavaScript function: function myFunction(x) { //your code here }

return x * 2

Which JavaScript event occurs when the user highlights the text in a form field?

select

JavaScript is considered to be a relatively easy language to learn because:

the basic syntax is simple and many examples with comments are available for you to study.

Which variable data type represents a value of "nothing?"

The null data type


संबंधित स्टडी सेट्स

Chapter 5 Literature Reviews: Finding and Critiquing Evidence

View Set

L-10 Selection Initial & Chapter 9: Application Forms - Biodata Assessments, Training & Experience Evaluations, and Reference & Social Media Checks

View Set

Collaborative Exam Prep: Reading Between the Signs

View Set

Chapter 47: Endocrine Dysfunction NCLEX

View Set

The Light Jar - Battle of the books

View Set

Topic 4: Prenatal Development and Birth

View Set