Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 9 pages
Other

ICT1512 Assignment 11 Hands-On Project 9-1

Document preview thumbnail
Preview 2 out of 9 pages

ICT1512 Assignment 11 Hands-On Project 9-1 solutions In this project you will work on a web page in which customers attach greeting messages to gifts purchased for friends and family. The contents of the greeting message will be entered on one web page form and then displayed as part of a shopping cart on a separate page. Data will be transferred from one page to the next by appending data to a query string. A preview of the shopping cart page with a sample gift card message is shown in Figure 9-22. Do the following: 1. Use your code editor to open the project09-01a_, project09-01b_, and project09-01b_ files from the js09 c project01 folder. Enter your name and the date in the comment section of each file and save them as project09- , , and , respectively. 2. Go to the file in your code editor. Edit the form element so that submitting the form opens the file using the get method. Close the file, saving your changes. 3. Go to the file in your code editor and add a script element linked to the file. Defer the loading of the script until the page finishes loading. Take some time to study the contents of the HTML file and then close the file, saving your changes. 4. Go to the file in your code editor. Apply the slice() method to the h object, storing the text after the first character in the query variable. 5. Use the replace() method to replace very occurrence of the + character in the query variable with a blank space. Apply the decodeURIComponent() method to replace every URI-encoded character in query with the matching character. 6. Appy the split() method to the query string to split the text at every occurrence of the & character, placing each name=value pair as a separate item in the cardFields array. 7. Create a for of loop that loops through every item in the cardFields array. At each iteration of the loop do the following: a. Split each item at the location of the = character, store the substrings in the nameValue array variable. b. Store the first item in the nameValue array in the name variable. Store the second item in the nameValue array in the value variable. c. Store the value of the value variable as the text content of the document element with an id equal to the name variable. 8. Save your changes to the file and then load in your web browser. Enter sample greeting text in the field of the web form and then click the Submit button. Verify that the browser opens the file with the text of the greeting message displayed in the page.

Content preview

ICT1512 2023 ASSIGNMENT 11
Hands-on Project 9-1
(with all the source code you need)
***There is a link to the PROJECT zipped folder at the end of this file***


Crystal Indigo!
Crystal Indigo!
Providing all solutions you need anytime
+27 76 626 8187




***copy the code to your editor, run or open with a browser***
Note: do not submit as pdf , CHANGE name and date

, <!-- project09-01a.html -->
<!DOCTYPE html>
<html>
<head>
<!--
JavaScript 7th Edition
Chapter 9
Hands-on Project 9-1

Author: Crystal Indigo
Date: 05/08/2023

Filename: project09-01a.html
-->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Hands-on Project 9-1</title>
<link rel="stylesheet" href="styles.css" />
</head>

<body>
<header>
<h1>
Hands-on Project 9-1
</h1>
</header>

<section>
<h1>Personal Greeting</h1>
<form method="get" action="project09-01b.html">
<fieldset>
<legend>Enter your personal greeting</legend>
<label for="to">To:</label>
<input name="to" id="to" type="text" />
<label for="from">From:</label>
<input name="from" id="from" type="text" />
<label for="msg">Message:</label>
<textarea name="msg" id="msg"></textarea>
</fieldset>
<input id="subButton" type="submit" value="SUBMIT" />
</form>
</section>
</body>
</html>

Connected book
 image
Patrick Carey, Sasha Vodnik JavaScript for Web Warriors
Publisher: 2021 ISBN: 9780357638033 Edition: Unknown

Document information

Uploaded on
August 5, 2023
Number of pages
9
Written in
2023/2024
Type
Other
Person
Unknown
$7.16

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
CrystalIndigo
4.1
(53)
Sold
490
Followers
226
Items
73
Last sold
2 months ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions