For your zipfile, make a copy of the it238 folder, then change the name of the copy to
proj0Saldana (replace Saldana with your last name). Then
create a zipfile of proj0Saldana, which results in
the zipfile named proj0Saldana.zip.
What is a stub page?s
Answer: a stub page is a placeholder the actual page (in this case your proj1a or proj1b
index.html
page). The stub page is used to check if the hyperlinks from the Project 0 index page to the stub page
and from the stub page back to the Project 0 index page work. These stub pages will be replaced
with the actual Project 1a and 1b pages when they are completed.
What is an entity? What are some common HTML entities that you know? Answer: An HTML entity
is a symbol that cannot be directly represented by a keyboard character.
It is of the form &entity_name; Here are some common
entities:
Entity Symbol
< <
> >
& &
" "
' '
nonbreaking space
β β (Greek letter beta)
→ → (right arrow)
← ← (left arrow)
“ “ (left double quotes)
Answer:
Basically they mean the same thing. However, with the
<button> tag, you can place additional HTML markup between the start and end
tags like this:
You can't put HTML markup in the value attribute of the <input> tag.
Finish separating the source code for the
BirthdayRiddle Example in the April 1 notes
into .html, .css, and
.js files.
Here is an explanation of the riddle:
Date
My Age
Description
Dec 30, 2024
21
Day Before Yesterday
Dec 31, 2024
22
My Birthday Last Year
Jan 1, 2025
22
Today
Dec 31, 2025
23
My Birthday This Year
Dec 31, 2026
24
My Birthday Next Year
What is JavaScript?
In September 1995 JavaScript was created in 10 days by Brendan Eich of
Netscape Communications.
It is a lightweight scripting language, used to build websites -- about 1.52
billion of them, 95% of all websites.
Originally, the name of JavaScript was Mocha. It was designed as a web
scripting companion to Java.
The name Mocha was changed to LiveScript for marketing purposes.
In 1998, AOL acquired Netscape and formed an alliance with Sun Microsystems
to develop web software. At that time that the name of LiveScript was
changed to JavaScript. This was a marketing ploy, based on the popularity of Java.
JavaScript and Java are very different, but the two languages have many
syntax elements in common.
ECMAScript (starting in 1997) is a standard for JavaScript, which is meant
to ensure the interoperability of web pages across different browsers. ECMA
means European Computer Manufacturers Association.
JavaScript Output
Hello World Example
Here are four ways in JavaScript to output text:
Using the Chrome Browser, click on the three dots icon in the upper right
corner; Select More tools >> Developer tools. In the HTML code
for Item 1, replace the line
document.writeln("Hello, World.");
with
console.log("Hello, World.");
Refresh the browser.
Writing to the browser console is useful for debugging.
Display a popup window
In the HTML code for Item 1, use
alert("Hello, World.");
instead of
console.log("Hello, World.");
Display Output in a Textfield
You already know how to do this from IT 130. We will look
the source code for this way to display output and at other possibilities later.
Functions
A function is a set of statements designed to perform a task.
A function must be called or invoked to execute the statements.
Test this function that converts a length from inches
to centimeters:
// BasicFunction Example
// Function definition:
function inToCm(inches) {
cm = inches * 2.54;
return cm;
}
// Function test:
var inches = prompt("Enter length in inches", "0");
var cm = inToCm(inches);
document.writeln("Length in cm: " + cm);
// If input is 1, the output is 2.54
// If input is 2, the output is 5.08