All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Ask a Question
Search
Search
Sign In
Register
study help
computer science
javascript
Questions and Answers of
JavaScript
Which function do you use as part of the process of parsing a cookie?a. encodeURI()b. decodeURI()c. encodeURIComponent()d. decodeURIComponent()
Cookies created without a(n) __________ attribute are available for the current browser session only.a. Pathb. Domainc. Expiresd. Name
You can use special characters in your cookies if you use __________.a. Secure codingb. Encodingc. A CDNd. The secure attribute
Which is the only required attribute of the cookie property?a. Pathb. Domainc. Expiresd. Name
Which type value for the input element creates a field that is not displayed by web browsers?a. Hiddenb. Invisiblec. Noned. Text
The __________ method of a form automatically creates a query string from its field values.a. Resetb. Changec. Clickd. Submit
To concatenate names and values into a query string, you can use methods of the __________ class.a. Arrayb. Stringc. Numberd. Date
What is a third-party script? How do you include one in a web document?
What are some advantages of using Web Storage rather than cookies? Why might a developer choose to continue using cookies?
How is a hidden form field different from other form fields?
What character is used to separate individual name-value pairs within a query string?a. &b. $c. ?d. %
What is the same origin policy?
How do you delete a cookie in your code?
How is data in a query string separated from a URL? How are individual name-value pairs distinguished within a query string?
HTTP was originally designed to be __________, which means that web browsers stored no persistent data about a visit to a web site.a. Hiddenb. Encryptedc. Statelessd. Stateful
What is a code injection attack?
What are the two main types of cookies? What is the difference between them?
How do you reference a passed query string in your code?
A pattern that matches the beginning or end of a line is called a(n) __________.a. Anchorb. Rootc. Metacharacterd. Class
Which statement moves the browser to the top of the page?a. Scroll(top)b. Scroll(0,0)c. Move(top)d. Move(0,0)
What property do you use to change the selected option element in a selection list? What value do you use to specify that no option element is selected?
In __________, some features are removed from the JavaScript language, while other features require more stringent syntax.a. Exception handlingb. Strict modec. Debugging toolsd. Debugger
Suppose your browser console lists a single error, which you find and fix. Why is it important to save your work and reload the page in the browser?
How can code editors designed for web development help you in identifying errors in your HTML?
What type of error occurs when the interpreter fails to recognize code?a. Debuggingb. Syntaxc. Run-timed. Logic
Explain the difference between syntax errors, run-time errors, and logic errors. Provide an example of each.
What are the two different statements you can add to your code to provide you with additional information while you’re debugging?
What is a breakpoint? How do you set a breakpoint?
When is it necessary to include exception handling in your code? Give an example.
What code would you enter on the command line to declare a variable named [BEG CODE]cost[END CODE] with a value of 75, and then log to the console the result of multiplying the cost variable by 1.2?
______ errors are problems in the design of a program that prevent it from running as you anticipate.a. Applicationb. Syntaxc. Logicd. Run-time
Where can you find error messages in a browser?
What statement would you use to log the text “itemTotal: ” plus the value of the itemTotal variable to the console?
Explain the differences between stepping in (or into), stepping over, and stepping out.
What statement in the code to handle an exception do you use to specify an error message?
Explain how coding in strict mode can help you write better code.
When a JavaScript interpreter encounters a problem while a program is executing, that problem is called a(n) ___ error.a. Applicationb. Syntaxc. Logicd. Run-time
When is commenting out code useful in debugging?
What is the call stack? How do you use it in debugging?
How do you reference a previously generated error message in a catch() statement?Data from Previous GeneratedWhat statement in the code to handle an exception do you use to specify an error message?
Which of the following statements causes a syntax error?a. var firstName = "";b. document.write(Available points: " + availPoints);c. readyState = true;d. "use strict";
Which of the following statements writes the value of the selection variable to the console?a. console.log("selection");b. document.console("selection");c. console.alert(selection);d.
Which of the following for statements is logically incorrect?a.b.c.d. for (var count 10; count
Which of the following modes temporarily suspends, or pauses, program execution so that you can monitor values and trace program execution?a. Suspendb. Stepc. Breakd. Continue
Which command executes all the statements in the next function in browser debugging tools?a. Step outb. Step overc. Stepd. Step in/into
After you throw an error, you use a(n) ___ statement to handle the error.a. Tryb. Throwc. Catchd. Finally
Which of the following pieces of information is passed as an argument from a throw statement to a catch statement? a. Error numberb. Error messagec. Line numberd. URL
What statement can you add to your code to effectively serve the same role as a breakpoint? a. Break;b. Breakpoint;c. Debug;d. Debugger;
The watch list in browser debugging tools lets you monitor the value of a(n) ______ during program execution. a. Functionb. Exception handlerc. Expressiond. Statement
The _____________ is the ordered list maintained by a JavaScript processor containing all the procedures, such as functions, methods, or event handlers, that have been called but have not yet
Which of the following exception handling code executes regardless of whether its associated try block throws an exception? a. throw "Please enter your last name.";b.c.d. catch (1Name Error) {
What is the advantage of tracing errors using the window.alert() method? What is the advantage of using the console.log() method instead?
Explain how to debug code by commenting it out.
Explain two different ways that a text editor specialized for web development can help you in preventing errors and debugging code.
When and why should you use exception handling with your JavaScript programs?
Explain what strict mode is, how to implement it, and how it’s useful in reducing coding errors.
Provide two statements that display the previous page in the browser history.
Which of the following objects is also referred to as the global object?a. Browser objectb. Screen objectc. Document objectd. Window object
What is the Window object?
What statement would you use to create a variable named logo and assign as its value a reference to the element with the id value logoImage?
What statement creates a new footer element?
What statement do you use to create a new, blank window?
What is the effect of the statement location.reload(true);?
In the browser object model, the History object is a _______ object to the Location object.a. Parentb. Grandparentc. Siblingd. Child
What is the DOM?
What statement would you use to create a variable named firstPriority and assign as its value a reference to the first li element in the document?
Name two methods you can use to add a node to the DOM tree, and explain the difference between them.
What happens if your apps include JavaScript code that opens a new window or tab without a request from the user?
What types of information can you access using the Screen object?
Each item in the DOM tree is known as a _______.a. Nodeb. Documentc. Objectd. Element
What is the difference between the Window object and the Document object? What is the relationship between the two?
What statement would you use to create a variable named language and assign as its value the value of the lang attribute of the html element?
How would the results of the following two statements differ?
What extra step do you need to take in code to create a new window if you want to be able to control the new window from the window that created it?
Which of the following is the correct syntax for accessing an element with the id value headline?a. document.getElementsByID("headline")b. document.getElementById("headline")c.
What statement would you use to change the value of the lang attribute of the html element to the value of the language variable?
Which of the following is the correct syntax for using the getElementsByTagName() method to return all of a document’s p elements?a. document.getElementsByTagName("")b.
Which of the following is the correct syntax for accessing the value of the href attribute for the third a element in a document? a. document.getElementsByTagName("a")[2].hrefb.
A set of connected nodes that are not part of a document is known as a(n) __________.a. History listb. Node listc. HTML collectiond. Document fragment
Which method allows you to insert a node at a position among its sibling nodes that you specify?a. createElement()b. appendChild()c. cloneNode()d. insertBefore()
How do you increase the likelihood that a new window you create with the window.open() method will open as a new window rather than a new tab?a. Specify the window=true option.b. Specify
Which object allows you to change to a new, unvisited web page from within JavaScript code?a. Historyb. Locationc. Navigatord. Screen
To make a window the active window, you use the _______ method of the Window object.a. Focus()b. Open()c. Close()d. Active()
How do you control a new window that you have created with JavaScript code?a. You cannot control a new window with JavaScript code.b. Assign the new Window object created with
Which method do you use to execute code only once after a specific amount of time has elapsed?a. setTimeout()b. setInterval()c. clearTimeout()d. clearInterval()
Which method do you use to execute code repeatedly, with a specific amount of time between each execution?a. setTimeout()b. setInterval()c. clearTimeout()d. clearInterval()
The properties of which object describe a user’s browser?a. Historyb. Locationc. Navigatord. Screen
List the six main objects that make up the browser object model. Describe the relationships between these objects using the terms parent, child, and sibling.
Suppose you’re working with a document that includes one img element, which has the id value logoImage. Provide the code for two ways of referencing this element.
Write code that displays a document named modelHDescription.htm in a new browser window that is 400px wide and 300px high, and then brings that window to the front of any other browser windows.
Explain the difference between the setTimeout() and setInterval() methods. Provide an example of when you’d use each one.
Explain how to center a window on the screen when it is created with the window.open() method.
Describe two common uses of JavaScript with forms.
If you were designing a form with a question that asked users if they owned a bicycle, would you expect more accurate input using a text input box or a check box? Why?
List two attributes that specify parameters for browser-based validation in child elements of a form, and describe what each does.
Which event fires when a form is submitted?
Objects representing each of the controls in a form are stored in the _____ collection.a. Formsb. Controlsc. Inputsd. Elements
Name two advantages of identifying form elements using the getElementById() method rather than by specifying their index numbers within the form.
List a value for the type attribute of the input element that triggers browser-based validation, and describe what content browsers check for.
What method do you use to disable the default behavior associated with an event?
Showing 100 - 200
of 386
1
2
3
4