Question

Use visual studio code to write the javascript programme. For this lab you must use a...

Use visual studio code to write the javascript programme.

For this lab you must use a reasonable faceted search example, each item must have at least three categorical attributes and at least one numeric attribute. Attributes such as ID, name etc do not count as categorical or numeric attributes.

(a) Define a class for your item that meets the above three categorical and one numeric attribute requirements.

(b) Create a text file that contains at least 5 such records in CSV format.

(c) Create a HTML page that contains a table element the shows one item record (hardcoded in the HTML).

(d) Add a script element into your HTML page that prints ‘hello’ to the browser’s JavaScript developer console.

(e) Add JavaScript code that uses ‘fetch’ into your HTML page that loads your item text file. Use a python initiated local server to serve that text file.

we need parse from text file and dosplay it in the table

Homework Answers

Answer #1

<html>

<head>

<body>

<table>

<tr>

<th>Industry Type</th>

<th>Occupational Safety and Health</th>

<th>Sources of Hazards</th>

<th>Scale of Workers</th>

</tr>

<tr>

<td>Chemical</td>

<td>General</td>

<td>Acid</td>

<td>200</td>

</tr>

</table>

<script>

console.log("Hello");

url='' //enter your url

let response = fetch(url);

if (response.ok) { // if HTTP-status is 200-299
// get the response body (the method explained below)
let json = response.json();
} else {
alert("HTTP-Error: " + response.status);
}
console.log(response)


</script>

</body>

</head>

</html>

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Use visual studio code to write the javascript programme. For this lab you must use a...
Use visual studio code to write the javascript programme. For this lab you must use a reasonable faceted search example, each item must have at least three categorical attributes and at least one numeric attribute. Attributes such as ID, name etc do not count as categorical or numeric attributes. (a) Define a class for your item that meets the above three categorical and one numeric attribute requirements. (b) Create a text file that contains at least 5 such records in...
Use visual studio code to write the javascript programme. Write a function that counts the number...
Use visual studio code to write the javascript programme. Write a function that counts the number of values each item attribute has. This is effectively a group-by on the item table for each column. For example: if the first attribute is colour, and its values are [ ‘red’, ‘black’, ‘white’, ‘black’, ‘red’ ], the counts for colour would be: red 2 black 2 white 1
PART B- Javascript Using a text editor (VS Code or Notepad) and a web browser, you...
PART B- Javascript Using a text editor (VS Code or Notepad) and a web browser, you will demonstrate how to create an HTML file, externally link a JavaScript file, and write some source code in the JavaScript file. a..Create two blank files to be an HTML file and a JavaScript file. The file names should be partA.html and partA.js. b.. Create a basic HTML webpage structure. c..Link the JavaScript file to the HTML file using the <script> tag. d.. Prompt...
You must implement a dynamic webpage the provides a basic task-list functionality. In particular, you page...
You must implement a dynamic webpage the provides a basic task-list functionality. In particular, you page should provide a user an interface to add and remove a task as well as mark a task as completed. For this version of the assignment, the tasks will be added directly in the HTML page by manipulating the DOM. Moreover, you should maintain an array that stores task details. Each task comprise of three fields: task-title: which is a one-line description of the...
For this lab assignment you will need to write some code and create some graphs. You...
For this lab assignment you will need to write some code and create some graphs. You may use excel to create your graphs, or other language of your choice. Your data needs to demonstrate the experimental running time for Selection Sort (code in book), Merge Sort (code in book), and the Arrays.sort() method. Here is a basic outline of how you need to code this assignment. 1) Create several arrays of size 100, 1000, 10000, 100000, 1000000, … (you need...
I have trouble in my code with - Create and append the fancySheet link element to...
I have trouble in my code with - Create and append the fancySheet link element to the document head - Create and append figBox element to element with id box - Populate the figure box with preview images of the five fancy style sheets I don't understand what went wrong. New Perspectives HMTL5, CSS3, and JavaScript T12 Case Problem 1: New Accents Photography JavaScript File Event Listener Go to the na_styler.js file in your editor. Add an event listener that...
6.12 LAB: Grade distribution In this lab, you will write a JavaScript program that generates a...
6.12 LAB: Grade distribution In this lab, you will write a JavaScript program that generates a bar graph of letter grades from a distributions of scores. Implement the parseScores function (1 point) Implement the parseScores function to take a space-separated string of scores as an argument and return an array of score strings. Each score is a number in the range [0, 100]. Ex: "45 78 98 83 86 99 90 59" → ["45","78","98","83","86","99","59"] Hint: JavaScript's string split() function can...
Section 1.1: Creating the First Table Locate the HTML comment that reads "table 1" just below...
Section 1.1: Creating the First Table Locate the HTML comment that reads "table 1" just below the opening body tag. Add a table tag with the following specifications using the style attribute and CSS: width with a value of 650 pixels a margin set to auto – this will center the table within the web page a border set to none - this removes the table border Add a table row (<tr>) Add a table data container tag (<td></td>) Within...
You must write a function that works like a small editor. It should open an existing...
You must write a function that works like a small editor. It should open an existing file (let us say this is File1.txt. This file must exist before the function is run), read it line by line. Then write it to another file (let us say this is File2.txt. This file need not exist since Python will create it). However, if a certain line exists in the first file, it should be replaced by another line supplied by you. You...
Use Python to Complete the following on a single text file and submit your code and...
Use Python to Complete the following on a single text file and submit your code and your output as separate documents. For each problem create the necessary list objects and write code to perform the following examples: Sum all the items in a list. Multiply all the items in a list. Get the largest number from a list. Get the smallest number from a list. Remove duplicates from a list. Check a list is empty or not. Clone or copy...