need help sovling this problem posted in image html code                Hands-on Project 4-3                            Hands-on Project 4-3                     Book Review Comment                                 Character Count: 0 / 1000                               .js code // Maximum Length of Review const MAX_REVIEW = 1000; document.getElementById("limit").innerHTML = MAX_REVIEW; // Reference to elemets in the web page wordCountBox = document.getElementById("countValue"); warningBox = document.getElementById("warningBox"); // Event listener for typing into the comment box document.getElementById("comment").addEventListener(keyup, updateCount); // Function to update the count with each keyup event function updateCount() {    // Set the warning box to an empty text string     warningBox.innerHTML = "";        // Count the number of characters in the comment box    commentText = document.getElementById("comment").value;    charCount = countCharacters(commentsText);     } /*=================================================================*/ // Function to count the number of characters in a text string function countCharacters(textStr) {    var commentregx = /\s/g;    var chars = textStr.replace(commentregx, "");    return chars.length;

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

need help sovling this problem posted in image

html code

<!DOCTYPE html>
<html>
<head>
   <!--
      JavaScript 7th Edition
      Chapter 4
      Hands-on Project 4-3

      Author: 
      Date:   

      Filename: project04-03.html
   -->
   <meta charset="utf-8" />
   <meta name="viewport" content="width=device-width,initial-scale=1.0">
   <title>Hands-on Project 4-3</title>
   <link rel="stylesheet" href="Styles/styles.css" />
   <link src="JS/project04-03_txt.js" defer></script>
</head>

<body>
   <header>
      <h1>
         Hands-on Project 4-3
      </h1>
   </header>

   <article>
      <h2>Book Review Comment</h2>
      
      <textarea id="comment" rows="" cols=""></textarea>
      
      <div id="countLabel">
      Character Count: <span id="countValue">0</span> / <span id="limit">1000</span>
      </div>
      
      <div id="warningBox"></div>
      
   </article>
</body>
</html>

.js code

// Maximum Length of Review
const MAX_REVIEW = 1000;
document.getElementById("limit").innerHTML = MAX_REVIEW;

// Reference to elemets in the web page
wordCountBox = document.getElementById("countValue");
warningBox = document.getElementById("warningBox");

// Event listener for typing into the comment box
document.getElementById("comment").addEventListener(keyup, updateCount);

// Function to update the count with each keyup event
function updateCount() {
   // Set the warning box to an empty text string 
   warningBox.innerHTML = "";
   
   // Count the number of characters in the comment box
   commentText = document.getElementById("comment").value;
   charCount = countCharacters(commentsText);
   
}

/*=================================================================*/
// Function to count the number of characters in a text string
function countCharacters(textStr) {
   var commentregx = /\s/g;
   var chars = textStr.replace(commentregx, "");
   return chars.length;

Do the following:
Hands-on Project 4-5
Book Review Comment
"Post Captain" is the second novel in Patrick O'Brian's "Jack Aubrey"
series and is a worthy successor to Master and Commander"
PREVIOUS PAGE
Review Questions
Character Count: 109 / 100
You have exceeded the character count limit
Completed Project 4-3
1. Use your code editor to open the project04-03_txt.html and project04-03_txt.js files from the js04▸ project04 folder. Enter your name and the date in the comment section of each file and save them as project04-03.html and project04-03.js, respectively.
2. Go to the project04-03.html file in your code editor and in the head section add a script element to load the project04-03.js file, deferring the loading of the JavaScript source file until the entire HTML file is loaded. Study the contents of the HTML file and save your changes.
3. Go to the project04-03.js file in your code editor. At the top of the file, insert a statement directing that the code be interpreted under strict standards.
4. Go to the updateCount() function. Insert at the bottom of the function a try catch finally statement that does the following:
a. Within the try statement, test if the charCount variable is greater than the value of the MAX_REVIEW constant. If it is, throw an exception with the error message "You have exceeded the character count limit.
b. For caught exceptions, display the error message within the innerHTML of the warningBox object.
c. Whether the exception is thrown or not, change the innerHTML of the wordCountBox object to the value of the charCount variable.
5. Save your changes to the file and then load project04-03.html in your web browser. Start typing text into the comment box.
6. There are several errors within the code. Use the debugger to find any syntax or runtime errors you encounter. Fix the errors in your code editor.
7. When the app is free of errors, attempt to type more than 100 characters into the comment box. Verify that when you exceed the character limit, a warning message appears on the page.
8. Return to your code editor and increase the value of MAX_COUNT from 100 to 1000.
Quick lour Print Search Annotations Accessibility Bookmark
NEXT PAGE
Case Projects
Transcribed Image Text:Do the following: Hands-on Project 4-5 Book Review Comment "Post Captain" is the second novel in Patrick O'Brian's "Jack Aubrey" series and is a worthy successor to Master and Commander" PREVIOUS PAGE Review Questions Character Count: 109 / 100 You have exceeded the character count limit Completed Project 4-3 1. Use your code editor to open the project04-03_txt.html and project04-03_txt.js files from the js04▸ project04 folder. Enter your name and the date in the comment section of each file and save them as project04-03.html and project04-03.js, respectively. 2. Go to the project04-03.html file in your code editor and in the head section add a script element to load the project04-03.js file, deferring the loading of the JavaScript source file until the entire HTML file is loaded. Study the contents of the HTML file and save your changes. 3. Go to the project04-03.js file in your code editor. At the top of the file, insert a statement directing that the code be interpreted under strict standards. 4. Go to the updateCount() function. Insert at the bottom of the function a try catch finally statement that does the following: a. Within the try statement, test if the charCount variable is greater than the value of the MAX_REVIEW constant. If it is, throw an exception with the error message "You have exceeded the character count limit. b. For caught exceptions, display the error message within the innerHTML of the warningBox object. c. Whether the exception is thrown or not, change the innerHTML of the wordCountBox object to the value of the charCount variable. 5. Save your changes to the file and then load project04-03.html in your web browser. Start typing text into the comment box. 6. There are several errors within the code. Use the debugger to find any syntax or runtime errors you encounter. Fix the errors in your code editor. 7. When the app is free of errors, attempt to type more than 100 characters into the comment box. Verify that when you exceed the character limit, a warning message appears on the page. 8. Return to your code editor and increase the value of MAX_COUNT from 100 to 1000. Quick lour Print Search Annotations Accessibility Bookmark NEXT PAGE Case Projects
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

yes it appears your solution is for an etirely different question please relook at the image and the code provided

html code

<!DOCTYPE html>
<html>
<head>
   <!--
      JavaScript 7th Edition
      Chapter 4
      Hands-on Project 4-3

      Author: 
      Date:   

      Filename: project04-03.html
   -->
   <meta charset="utf-8" />
   <meta name="viewport" content="width=device-width,initial-scale=1.0">
   <title>Hands-on Project 4-3</title>
   <link rel="stylesheet" href="Styles/styles.css" />
   <link src="JS/project04-03_txt.js" defer></script>
</head>

<body>
   <header>
      <h1>
         Hands-on Project 4-3
      </h1>
   </header>

   <article>
      <h2>Book Review Comment</h2>
      
      <textarea id="comment" rows="" cols=""></textarea>
      
      <div id="countLabel">
      Character Count: <span id="countValue">0</span> / <span id="limit">1000</span>
      </div>
      
      <div id="warningBox"></div>
      
   </article>
</body>
</html>

.js code

// Maximum Length of Review
const MAX_REVIEW = 1000;
document.getElementById("limit").innerHTML = MAX_REVIEW;

// Reference to elemets in the web page
wordCountBox = document.getElementById("countValue");
warningBox = document.getElementById("warningBox");

// Event listener for typing into the comment box
document.getElementById("comment").addEventListener(keyup, updateCount);

// Function to update the count with each keyup event
function updateCount() {
   // Set the warning box to an empty text string 
   warningBox.innerHTML = "";
   
   // Count the number of characters in the comment box
   commentText = document.getElementById("comment").value;
   charCount = countCharacters(commentsText);
   
}

/*=================================================================*/
// Function to count the number of characters in a text string
function countCharacters(textStr) {
   var commentregx = /\s/g;
   var chars = textStr.replace(commentregx, "");
   return chars.length;
}

Do the following:
Hands-on Project 4-5
Book Review Comment
"Post Captain" is the second novel in Patrick O'Brian's "Jack Aubrey"
series and is a worthy successor to Master and Commander"
PREVIOUS PAGE
Review Questions
Character Count: 109 / 100
You have exceeded the character count limit
Completed Project 4-3
1. Use your code editor to open the project04-03_txt.html and project04-03_txt.js files from the js04▸ project04 folder. Enter your name and the date in the comment section of each file and save them as project04-03.html and project04-03.js, respectively.
2. Go to the project04-03.html file in your code editor and in the head section add a script element to load the project04-03.js file, deferring the loading of the JavaScript source file until the entire HTML file is loaded. Study the contents of the HTML file and save your changes.
3. Go to the project04-03.js file in your code editor. At the top of the file, insert a statement directing that the code be interpreted under strict standards.
4. Go to the updateCount() function. Insert at the bottom of the function a try catch finally statement that does the following:
a. Within the try statement, test if the charCount variable is greater than the value of the MAX_REVIEW constant. If it is, throw an exception with the error message "You have exceeded the character count limit.
b. For caught exceptions, display the error message within the innerHTML of the warningBox object.
c. Whether the exception is thrown or not, change the innerHTML of the wordCountBox object to the value of the charCount variable.
5. Save your changes to the file and then load project04-03.html in your web browser. Start typing text into the comment box.
6. There are several errors within the code. Use the debugger to find any syntax or runtime errors you encounter. Fix the errors in your code editor.
7. When the app is free of errors, attempt to type more than 100 characters into the comment box. Verify that when you exceed the character limit, a warning message appears on the page.
8. Return to your code editor and increase the value of MAX_COUNT from 100 to 1000.
Quick lour Print Search Annotations Accessibility Bookmark
NEXT PAGE
Case Projects
Transcribed Image Text:Do the following: Hands-on Project 4-5 Book Review Comment "Post Captain" is the second novel in Patrick O'Brian's "Jack Aubrey" series and is a worthy successor to Master and Commander" PREVIOUS PAGE Review Questions Character Count: 109 / 100 You have exceeded the character count limit Completed Project 4-3 1. Use your code editor to open the project04-03_txt.html and project04-03_txt.js files from the js04▸ project04 folder. Enter your name and the date in the comment section of each file and save them as project04-03.html and project04-03.js, respectively. 2. Go to the project04-03.html file in your code editor and in the head section add a script element to load the project04-03.js file, deferring the loading of the JavaScript source file until the entire HTML file is loaded. Study the contents of the HTML file and save your changes. 3. Go to the project04-03.js file in your code editor. At the top of the file, insert a statement directing that the code be interpreted under strict standards. 4. Go to the updateCount() function. Insert at the bottom of the function a try catch finally statement that does the following: a. Within the try statement, test if the charCount variable is greater than the value of the MAX_REVIEW constant. If it is, throw an exception with the error message "You have exceeded the character count limit. b. For caught exceptions, display the error message within the innerHTML of the warningBox object. c. Whether the exception is thrown or not, change the innerHTML of the wordCountBox object to the value of the charCount variable. 5. Save your changes to the file and then load project04-03.html in your web browser. Start typing text into the comment box. 6. There are several errors within the code. Use the debugger to find any syntax or runtime errors you encounter. Fix the errors in your code editor. 7. When the app is free of errors, attempt to type more than 100 characters into the comment box. Verify that when you exceed the character limit, a warning message appears on the page. 8. Return to your code editor and increase the value of MAX_COUNT from 100 to 1000. Quick lour Print Search Annotations Accessibility Bookmark NEXT PAGE Case Projects
Solution
Bartleby Expert
SEE SOLUTION
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY