How can I make this code broken in two separate files to run? Javascript: Unit 3 Exercise 2 Name, Math Tables Please select a table Addition Table Multipication Table
How can I make this code broken in two separate files to run? Javascript: Unit 3 Exercise 2 Name, Math Tables Please select a table Addition Table Multipication Table
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
How can I make this code broken in two separate files to run? Javascript:
<!DOCTYPE html>
<html>
<head>
<!--
CIS213 Unit 3,Exercise 2
Author:
Date:
-->
<meta charset="utf-8" />
<metaname="viewport" content="width=device-width, initial-scale=1.0">
<title>Unit 3 Exercise 2</title>
<script>
"use strict"
function additionTable() {
var tableWin = window.open("", "MathTableDisplay",
"toolbar=no, menubar=no, location=no, scrollbar=yes, resizable=no, width=500, height=400");
tableWin.document.open();
//adds the author name and table name
tableWin.document.write("<h1>Name, Addition Table</h1>");
tableWin.document.write("<table border='1' width='100%'>");
//create the top header row
tableWin.document.write("<tr><th> </th>");
for (var i = 0; i < 11; i++) {
tableWin.document.write("<th>" + i + "</th>");
}
tableWin.document.write("</tr>");
//create the row headers and the solutions
for (i = 0; i < 11; i++) {
tableWin.document.write("<tr align='center'><td>" + i + "</td>");
for (var j = 0; j < 11; j++) {
tableWin.document.write("<td>" + (i + j) + "</td>");
}
tableWin.document.write("</tr>");
}
tableWin.document.write("</table>");
tableWin.document.close();
tableWin.focus();
}
//Multiplication Table
function multiplicationTable() {
vartableWin=window.open("","MathTableDisplay",
"toolbar=no, location=no, scrollbar=yes, resizable=no, width=500, height=400");
tableWin.document.open();
//adds the author name and table name
tableWin.document.write("<h1>Name, Multiplication Table</h1>");
tableWin.document.write("<table border='1' width='100%'>");
//create the top header row
tableWin.document.write("<tr><th> </th>");
for (var i = 0; i < 11; i++) {
tableWin.document.write("<th>" + i + "</th>");
}
tableWin.document.write("</tr>");
//create the row headers and the solutions
for (i = 0; i < 11; i++) {
tableWin.document.write("<tr align='center'><td>" + i + "</td>");
for (var j = 0; j < 11; j++) {
tableWin.document.write("<td>" + (i * j) + "</td>");
}
tableWin.document.write("</tr>");
}
tableWin.document.write("</table>");
tableWin.document.close();
tableWin.focus();
}
</script>
</head>
<body>
<h1>Name, Math Tables</h1>
<h2>Please select a table</h2>
<button onclick="additionTable()">Addition Table</button>
<button onclick="multiplicationTable()">Multipication Table</button>
</body>
</html>
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step 1: Define as Introduction
VIEWStep 2: Define as Explanation
VIEWStep 3: Define as multiplicationTable.js
VIEWStep 4: Define as additionTable.js
VIEWStep 5: Define as main html file
VIEWStep 6: Define as screenshot - part 1
VIEWStep 7: Define as screenshot - part 2
VIEWStep 8: Define as screenshot - part 3
VIEWStep 9: Define as screenshot - part 4
VIEWSolution
VIEWStep by step
Solved in 10 steps with 4 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education