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
Hire a Tutor
AI Study Help
New
Search
Search
Sign In
Register
study help
computer science
beginning javascript
Questions and Answers of
Beginning JavaScript
Modify the answer to Chapter 14’s Question 2 using Prototype. Also add error reporting for when an error occurs with the Ajax request.
There is some repetitive code in Example 2. Refactor the code to reduce the duplication. Additionally, add a function to handle any errors that may occur with the request.
Example 1 is based on Chapter 10’s Example 17, and as you probably remember, you modified that example in response to one of Chapter 10’s exercise questions. Modify this chapter’s Example 1 so
Add another range form control to Question 1’s answer, and program it to seek the media. It should also update as the media plays. Use the durationchange event to set the slider’s max value, and
Being able to control playback is cool, but your custom UI needs to also control volume. Add an element to Example 3 to control the volume. Remember that the range of volume supported by media
The code for alerting a single message in Example 1 isn’t very exciting. Modify the code to display a random message from a set of three possible messages.
Example 17 had you write a cross-browser tab script, but as you probably noticed, it behaves peculiarly. The basic idea is there, but the tabs remain active as you click another tab. Modify the
Example 15 exhibits some behavior inconsistencies between standards-compliant browsers and old-IE. Remember that the event handlers execute in reverse order in old-IE. Modify this example to use the
Modify Example 3 from the “Image Selection” Try It Out to display one of the four images randomly.
Create a web page similar to Example 5 in the “A Counting Clock” Try It Out, but make it display only the hour, minutes, and seconds.
ch5_example8.html uses a function to create objects using literal notation. Modify this example to use the Person data type.
Use local storage to load a different advertisement every time a user visits a web page.
The following code uses the prompt() function to get two numbers from the user. It then adds those two numbers and writes the result to the page:However, if you try out the code, you’ll discover
A junior programmer comes to you with some code that appears not to work. Can you spot where he went wrong? Give him a hand and correct the mistakes.var userAge = prompt("Please enter your age"); if
Using document.write(), write code that displays the results of the 12 times table. Its output should be the results of the calculations. * 12 1 = 12 * 12 2 = 24 12 * 3 = 36... 11 = 132 12 =
Add a method to the event utility object called isOldIE() that returns a boolean value indicating whether or not the browser is old-IE.
Modify ch9_example6.html from the “Animating Content” Try It Out so that the amount of pixels moved in either direction is controlled by a global variable. Call it direction. Remove the
Create a page that gets the user’s date of birth. Then, using that information, tell her on what day of the week she was born.
Create two pages, one called legacy.html and the other called modern.html. Each page should have a heading telling you what page is loaded. For example:Using feature detection and the location
Modify the code of Question 1 to request the times table to be displayed from the user; the code should continue to request and display times tables until the user enters -1. Additionally, do a check
Change the code of Question 2 from Chapter 3 so that it’s a function that takes as parameters the times table required and the values at which it should start and end. For example, you might try
Using the Date type, calculate the date 12 months from now and write this into a web page.
What problem does the following code solve?Why would this not work, and how could you rectify the problem? var myString = "This sentence has has a fault and and we need to fix it." var myRegExp =
Obtain a list of names from the user, storing each name entered in an array. Keep getting another name until the user enters nothing. Sort the names in ascending order and then write them out to the
Write a regular expression that finds all of the occurrences of the word “a” in the following sentence and replaces them with “the”: “a dog walked in off a street and ordered a finest
Imagine you have a website with a message board. Write a regular expression that would remove barred words.
Here’s some HTML code that creates a table. Re-create this table using only JavaScript and the core DOM objects to generate the HTML. Test your code in all browsers available to you to make sure it
Using the code from the temperature converter example you saw in Chapter 2, create a user interface for it and connect it to the existing code so that the user can enter a value in degrees Fahrenheit
Create a user interface that allows users to pick the computer system of their dreams, similar in principle to the e-commerce sites selling computers over the Internet. For example, they could be
Using local storage, create a page that keeps track of how many times the page has been visited by the user in the last month.
Extend the HttpRequest module to include synchronous requests in addition to the asynchronous requests the module already makes. You’ll have to make some adjustments to your code to incorporate
It was mentioned earlier in the chapter that you could modify the smart form to not use hyperlinks. Change the form that uses the HttpRequest module so that the Username and Email fields are checked
If you guessed that this question would be: “Change the answer to Chapter 14’s Question 2 using MooTools, and add error reporting for when an error occurs with the Ajax request” then you won!!
The example ch18_example4.html has a deliberate bug. For each times table it creates only multipliers with values from 1 to 11.Use the script debugger to work out why this is happening, and then
The following code contains a number of common errors. See if you can spot them: Chapter 18: Question 2 17 CheckBox 1 CheckBox 1