Zybook Midterm1 1-4, 6-7
console.log()
Output may be produced using the function console.log(), which displays text or numbers in the console. The console is a location where text output is displayed.
Dynamic typing
Dynamic typing determines a variable's type at run-time.
Declaration block
A declaration block contains one or more declarations separated by semicolons (;)
top-level domains (TLD)
A domain name belongs to one of numerous top-level domains (TLD), such as .com, .net, .org, .edu, and .gov.
fallback
A fallback is a mechanism that allows a web page element to function correctly even if the browser does not support a particular element. Good practice is to implement a fallback mechanism if a particular HTML5 widget is not widely supported by browsers at the time.
<p>
A paragraph is enclosed in HTML by the <p> opening and closing tags. Browsers visually separate paragraphs from other text with spacing above and below.
polyfill
A polyfill is a fallback using JavaScript code that makes certain features of HTML5 (Ex: the date picker) work on browsers that do not natively support those HTML5 features. Developers often use a JavaScript library such as Modernizr to detect which features the browser does not support, and then load one or more polyfills to provide fallback mechanisms for the non-supported HTML5 features.
text box widget
A text box widget is an input element with the type attribute of "text" that allows users to enter a single line of text.
Truthy and falsy
A truthy value is a non-Boolean value that evaluates to true in a Boolean context. Ex: if (18) evaluates to true because non-zero numbers are truthy values. A falsy value is a non-Boolean value that evaluates to false in a Boolean context. Ex: if (null) evaluates to false because null is a falsy value.
try-catch statement
A try-catch statement has a try block to execute code that may throw an exception and a catch block that executes when an exception is thrown
standards mode
A web page with the DOCTYPE is rendered using standards mode, which uses the HTML5 standard.
<code>
Computer code
root servers
hirteen main DNS servers (called root servers) exist in the world, and a computer's operating system or an ISP keeps a reference to the root servers' IP addresses. Ex: 198.41.0.4 (run by Verisign), 192.228.79.201 (run by USC), 199.7.91.13 (run by Univ. of Maryland), and 192.203.230.10 (run by NASA).
HSL color value
hsl(hue, saturation, lightness) function by indicating the hue, saturation, and lightness values. The hue value ranges between 0 and 360, and the saturation and lightness values range between 0% and 100%.
Sibling elements
Sibling elements are elements that share the same parent element.
required
States that input is required and the field must not be left empty. E.g. required <input type="password" required>
three main characteristics of web pages
markup HyperText Language
window.innerHeight and window.innerWidth
are the height and width in pixels of the window's content area. Ex: window.innerWidth returns 600 if the browser's content area is 600 pixels wide.
Common CSS properties
color, background, font, (float, clear), text-align, display
console.dir()
displays a JavaScript object to the console. The browser usually supports a method for compactly representing the object. Ex: a hierarchical tree representation allowing a developer to expand and collapse the object contents.
window.confirm()
displays a confirmation dialog box with OK and Cancel buttons. confirm() returns true if OK is pressed and false if Cancel is pressed. Ex: window.confirm("Are you sure?") displays a dialog box with the question.
window.alert() method
displays an alert dialog box. Ex: window.alert("Hello") displays a dialog box with the message "Hello".
console.error()
displays errors to the console. The browser usually has a special indicator to differentiate an error from a warning or the standard log message. Ex: A red error box.v
console.warn()
displays warnings to the console. The browser usually has a special indicator to differentiate a warning from the standard log message. Ex: A yellow warning box.
IPv6
uses 128-bit addresses, capable of representing 2128 addresses. That number is or 3.4 × 1038 or 340,000,000,000,000,000,000,000,000,000,000,000,000 hopefully enough for quite a while. IPv4 and IPv6 currently co-exist, and likely will for a long time.
graphical hyperlink
uses an image inside a hyperlink instead of text. Ex: The following HTML uses an image of a dog that links to the American Kennel Club .
W3C
the World Wide Web Consortium) is the international standards organization that controls web standards.
DNS lookup
the web browser performs a DNS lookup by sending the domain name to the local DNS and getting back the IP address of the web server hosting the domain name. Ex: https://www.w3c.org/ has a domain name of www.w3c.org, and DNS translates www.w3c.org to the IP address 128.30.52.45. Before a TCP connection is created, the web browser performs a DNS lookup
<meta> tag differs from other tags in two ways:
1) The <meta> tag uses an attribute to indicate the character set. 2) The <meta> element does not use a closing tag because <meta> is a void element.
A URL is composed of several parts:
1)Scheme - Characters at the beginning of a URL followed by a colon ":" or a colon and double slashes "://". Common URL schemes include http, https, mailto, and file. Ex: In http://www.cdc.gov/alcohol, the scheme is "http". 2)Hostname - The complete domain name specified in the URL. Ex: In http://www.cdc.gov/alcohol, the hostname is "www.cdc.gov". 3) Path - All characters to the right of the hostname in the URL. Ex: In http://www.cdc.gov/alcohol, the path is "/alcohol".
A polyfill for supporting the date input can use Modernizr and the jQuery datepicker by:
1. Loading the jQuery and Modernizr libraries. Calling a jQuery function that: 2. Uses Modernizr to determine whether the date input is supported Uses the jQuery datepicker if needed 3. The original input form is unmodified by the polyfill.
block
A block tag's content tries to fill the width of the tag's parent container and can contain other block tags, inline tags, and text. Block tags include headings, tables, and paragraphs.
Style Sheet
A language describing the visual presentation of structured documents.
self-invoking function
A self-invoking function is an anonymous function that invokes (calls) itself.
Language
A set of rules describing how to write HTML
colspan and rowspan
A single table cell occupies a single row and column by default, but a cell may span multiple columns or multiple rows using the colspan and rowspan attributes. The colspan and rowspan attributes apply to <td> and <th> tags.
id attribute and fragment identifier
Adding the id attribute to any HTML tag creates a fragment identifier, thus permitting URLs to link directly to that location in the document.
Input pickers
An input picker is a widget that allows the user to interactively pick a choice using a popup or other guided selection method.
domain name registrar
Anyone may register an unused domain name with a domain name registrar. Most registrars charge a yearly fee for keeping the domain registered. Once a domain name is registered, the owner's name, address, and other registration information is made publicly available from ICANN's Whois service.
The value attribute can be used to validate user-entered text by checking desired properties, such as:
Checking for a specific length using the length property on the value attribute Checking if entered text is a specific value using === Checking is the text contains a specific value using the string indexOf() method on the value attribute Checking that text matches a desired pattern using a regular expression and the string match() method
HTTP request and response headers.
Content-Length: Number of bytes in the response's message body. Content-Type: Media type of the response's message body. Date: Datetime the response was generated by the web server. Last-Modified: Datetime the requested resource was last modified on the web server. Server: Identifies the web server software that generated the response. Host: The domain name for the requested path. User-Agent: Identifies the browser making the request.
<var>
Definition of a variable in a computer program
Map object
ECMAScript 6 defines a Map object that stores key/value pairs. The Map object provides a few advantages over an Object for storing maps or associative arrays. However, not all browsers support the Map object yet
Javascript
Enables document interaction is a programming language that runs in a browser, enabling web pages supporting actions like responding to a button click. JavaScript can be included in the HTML file's header part.
One script element can be used to reference multiple external JavaScript files.
FALSE, Each external JavaScript file must be referenced by separate script elements.
WebP
Google created the WebP image format that supports true color, transparency, and animation. WebP can compress image information more efficiently than other formats in some situations. WebP may become more popular in the future as more browsers add WebP support.
file
Hyperlink used to refer to a document on the same computer as the web browser.
mailto
Hyperlink used to send email.
lossy compression
JPEG images use lossy compression, meaning that some of the original picture information is lost. A photograph is best saved as a JPEG image because humans cannot easily perceive the quality loss in a photograph.
CSS
Manages document presentation is a textual language for describing how a web page is styled for visual presentation. CSS controls the look and layout of web page content.
built-in objects
Numerous built-in objects exist that perform a wide range of operations. A built-in object is a global object that is always available
true color
PEG and PNG images can display true color (24-bit color), which is approximately 16 million different colors. GIF images are limited to only 256 colors (8-bit color), but GIF images can display animations, which are popular on social media.
pattern
Provides a pattern (called a regular expression) that input must match. E.g. pattern="[ABC][0-9]" only permits entering a two-character value that first has A, B, or C, and is then followed by a single digit. <input type="text" pattern="[ABC][0-9]">
JavaScript defines several other Error constructors, including:
RangeError - Thrown when a numeric variable or parameter is outside the valid range. InternalError - Thrown when an internal error occurs in the JavaScript interpreter. TypeError - Thrown when a variable or parameter is not the expected data type
<samp>
Sample output from a computer
min
Sets the minimum value that the input can have. E.g. min="1976-07-04" limits the date input value to no earlier than the U.S. bicentennial date, July 4, 1976. <input type="date" min="1976-07-04">
step
Sets amount by which the value can change. E.g., step="5" means that the value can only change by multiples of 5. <input type="range" step="5">
HyperText
Text that contains connections to other documents.
<b>
The <b> tags cause enclosed text to render using bold.
<label>
The <label> tag displays descriptive text associated with a specific widget. A label has a for attribute whose value should match the id attribute for the widget being labeled.
Error object
The Error object represents a runtime error, which is an error that occurs when the program is executing
<audio>
The HTML5 <audio> element plays an audio file in a web page. The <source> element is used inside the <audio> tag to specify an audio file to play.
ID name selector
The ID name selector, specified with a hash character followed by the ID name, matches the element that has the specified ID. Ex: #byLine { color: blue; } selects the element with the byLine ID attribute.
Math object
The Math object provides properties for mathematical constants and methods to perform mathematical functions
delete operator
The delete operator removes keys/properties from an associative array or object. The in operator returns true if an object contains the given property and returns false otherwise
Float property
The float CSS property specifies whether the element will float to the right or left of the element's parent, allowing text to flow around the element. The clear property moves an element down to avoid previously floated elements on the left, right, or both sides.
Early 1990's
The period when the web was first developed.
The image tag contains two attributes
The src attribute specifies the URL location of the image file to display. The alt attribute provides a text description to use as an alternative to displaying the image.
text-align
The text-align property changes the horizontal alignment of text for an element. Text is left aligned using the value left, right aligned with right, center aligned with center, or fully justified with justify. Spaces in justified text are stretched so each line of wrapped text fills the element. ex. text-align: left
DNS server
When a computer sends a packet using a domain name over the Internet, the first step is to contact a DNS server to convert the domain name to an IP address.
Document Object Model (or DOM)
a general way to represent and access all parts of HTML and XML documents. Together, JavaScript and the DOM provide browsers with the tools for making web pages interactive by accessing and changing any part of a web page.
CSS (Cascading Style Sheets)
a language that can be used to style a web page via changes in colors, sizes, spacing, fonts, and more
defer attribute
allows the browser to load the web page concurrently with loading the JavaScript, but the JavaScript is not processed until the web page is completely loaded.
Mobile devices
are handheld computers such as smartphones and tablets
href
attribute specifies the hyperlink's URL.
CSS color
can be a pre-defined name as in color:blue, or an rgb value as in color:rgb(50, 100, 255).
CSS rule
consists of a selector, an opening curly brace ({), a declaration block, and then a closing curly brace (})
anchor tag <a>
defines a hyperlink in a web page.
polyfill
is JavaScript code that provides missing standard functionality for older browsers. A polyfill typically checks for the presence of a feature in the browser and uses the builtin version if available. Otherwise, the polyfill executes JavaScript code that implements similar functionality. Common polyfill uses include HTML5 forms, video and audio, geo-location, and WebGL.
DNS
is short for Domain Name System.
rgb
is short for red, green, blue; all colors can be formed by combining those three colors. Values range from 0 (none) to 255 (bright).
JSON.parse
method creates a JavaScript object from a string containing JSON. Ex: JSON.parse('[1,"two",null]'),
JSON.stringify
method creates a string from a JavaScript object. Ex: JSON.stringify(new Date('2016-08-06')) converts the JavaScript Date object to the string 2016-08-06T00:00:00.000Z by calling the Date object's toJSON method.
asynchronous request
occurs when the web application sends a request to the server and continues running without waiting for the server response.
What window method is ideal for displaying a pop-up advertisement?
open
childNodes
property is an array-like collection of objects for each of the node's children
heading
provides a title for a section of content. Headings are visually separated from the other text by extra spacing and are displayed with a different appearance. Heading tags exist for the first six levels of nested sections.
Third-level and further level domains
refer to sub-computer systems local to an organization, as in cs.stanford.edu where the cs is for Stanford's Computer Science department. A common third-or-deeper-level domain is www, short for World Wide Web, usually referring to an organization's web server. Many organizations use www optionally, so stanford.edu by default goes to www.stanford.edu.
document.getElementById
returns the DOM node whose id attribute is the same as the method's parameter.
query string
s a set of name=value pairs separated by the ampersand character (&).
Steps in an HTTPS transaction.
step 1 : Browser requests an HTTPS to a web page. step 2 : Web server sends a digital certificate to the browser step 3 : The browser and web server initiate an SSL handshake. step 4: The browser and web server transmit encrypted information.
variable
stores a value or a link to an element of a web page. Using the link stored in a variable allows JavaScript to directly modify the properties of an element defined elsewhere in the HTML document. Ex: x stores the element with id="Colorable".
<input>
tag allows the user to enter information into a web page
ICANN
the organization that manages TLDs, now allows companies and organizations to create customized TLDs, like .church, .pizza, and .music.
The DOM is accessible via the global object named document.
true
span { font-weight: bold; font-size: 2em; } valid or invalid???
valid, While a single line may contain multiple rules, good practice is to place each declaration on a separate line.
div { font-family: serif } valid or invalid???
valid, While the last rule declaration of a block does not require a trailing semicolon, good practice is to add a semicolon to each rule.
variables
variables are declared with the keyword var. A variable is a named container that stores a value. A variable does not have to be declared before being assigned a value
404 error message
which is a code number for page not found. Various other codes exist. Many web servers return a page that includes the number "404".
document.writeln()
which outputs HTML into the document and alters the DOM.
text area
widget is an input element specified by <textarea> opening and closing tags that allows users to enter multiple lines of text. A <textarea> tag has optional rows and cols attributes to specify the initial size of the text area.
hexadecimal color
#RRGGBB format by indicating the red, green, and blue intensities. Each intensity for red, green, and blue is between 00 and ff hexadecimal numbers, where 00 is the lowest intensity and ff is the highest.
non-breaking hyphen
‑, looks like a regular hyphen, but acts like a normal character in the middle of a word.
Logical operators
&&, ||, !. Multiple && and || conditions may be combined into a single complex condition. Ex: (1 < 2 && 2 < 3 || 3 < 4).
non-breaking space
, looks like a single space, but acts like a normal character in the middle of a word.
Array methods
.push(value), .pop(), .shift(), Removes the first array element and returns the element .splice(startingIndex, totalElementsToDelete, valuesToAdd), Adds or removes elements from anywhere in the array and returns the deleted elements (if any)
An HTTP request and an HTTP response are both composed of four parts:
1. Status line 2. Zero or more header fields 3. Empty line 4. Optional message body The web server is able to identify the requested resource from the path in the status line. The web server sends back the requested resource in the message body of the response.
The steps for using the XMLHttpRequest API are:
1.Create a new XMLHttpRequest object. 2.Assign handlers to the desired events via the addEventListener() method. The addEventListener() method takes two arguments: the event name and the event handler, code that should execute when the event occurs. If the handlers are not set up prior to calling the open method, the progress events will not execute. 3.Initialize a connection to a remote resource using the open() method. The open() method takes two arguments: the HTTP request type and the URL for the resource. Most browsers only support "GET" and "POST" request types. 4.Modify the default HTTP request if needed by using the setRequestHeader() method. Ex: xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") sets the Content-Type header so a URL-encoded string may be sent in a POST request. 5.Send the HTTP request via the send() method. For POST requests, the data to be sent with the request is passed as the argument to the send() method.
Common HTML containers.
<header>-Container for introductory content <footer>-Container for content descriptive information about the web page like author, copyright, or date modified <section>-Container for distinct parts of a document, such as a chapter <article>-Container for self-contained content that can be reused independently, such as a news article <nav>-Container for content relating to website navigation <aside>-Container for content not directly related to the main topic of a document <div>-Generic tag for creating block containers <span>-Generic tag for creating inline containers
<div>
A <div> tag is a generic tag for creating block containers to facilitate managing page content, and is the only block tag with no semantic meaning, unlike other block tags such as <p> and <table>.
Selector
A CSS selector specifies the HTML elements to which the specific style rule apply
Declaration
A CSS styling declaration indicates what value is assigned to a styling property.
Date object
A Date object represents a single moment in time, based on the number of milliseconds since the Unix Epoch (January 1, 1970 UTC). UTC (Coordinated Universal Time), also known as GMT (Greenwich Mean Time), is 24-hour time standard.
fragment
A URL can point to a section, or fragment, of a document by adding a hash tag and a fragment identifier at the end of the URL
boolean attribute
A boolean attribute is an attribute that is true when present false when absent. Ex: The checked attribute for a checkbox widget is a boolean attribute. If the checked attribute is set, the checkbox will start in the selected state; otherwise, the checkbox will start in the unselected state. <input type="checkbox" name="foodPreference" value="vegetarian" checked> is the preferred way to use the checked boolean attribute.
button
A button widget can be created using the <button> opening and closing tags or with <input type="button">. The <button> element allows text and images to be displayed in a button, but an <input> button only allows text.
checkbox
A checkbox is a widget for input elements with the type attribute of "checkbox", which allows users to check, or select, a value.
closing tag
A closing tag indicates the ending point in the document where the tag stops having an effect.
website
A collection of related web pages are organized into a website and stored on a web server.
Comment
A comment is any text intended for humans that is ignored by the JavaScript interpreter.
compound assignment operator
A compound assignment operator combines an assignment statement with an arithmetic operation. += ,-= ,*= ,/= ,%=
Constant
A constant is an initialized variable whose value cannot change. ECMAScript 6 introduced the const keyword to define a constant. Most modern browsers support or partially support const.
constructor
A constructor is a function that creates an instance of an object
finally block
A finally block may follow a try or catch block. The finally block executes regardless of whether an exception was thrown or not.
for loop
A for loop executes the initialization expression, evaluates the loop's condition, and executes the loop body if the condition is true. After the loop body executes, the final expression is evaluated, and the loop condition is checked to determine if the loop should execute again.
function
A function is a named group of statements. JavaScript functions are declared with the function keyword. Functions may take any number of parameters and may return a single value using the return statement. A function that is missing a return statement returns undefined. Invoking a function's name, known as a function call, causes the function's statements to execute.
hyperlink
A hyperlink, or link, specifies where other information is located and what action the web browser should perform when a user clicks the hyperlink.
link
A link on a web page is a clickable item that causes the web browser to jump to another web page when clicked. Ex: Click here is a link to an interesting website. A button or image can also have a link.
list box
A list box widget is created by specifying a size with the select element's size attribute. Ex: <select size="4"> creates a list box that shows four options at a time. If the list box contains more than size options, the browser adds a vertical scrollbar so the user can scroll through the list of options.
Method
A method is a function that is attached to an object and operates on data stored in the object. Methods are called by prefacing the method with the object. Ex: myArray.method();.
identifier
A name created by a programmer for an item like a variable or function is called an identifier. JavaScript imposes the following rules for identifiers: - can be any combination of letters, digits, underscores, or $. - may not start with a digit. - may not be a reserved word like var, function, or while.
browser
A program for viewing web pages.
digital certificate
A website wanting to use HTTPS must acquire a digital certificate issued by a trusted certificate authority, which contains a public key needed to encrypt data between the browser and web server.
widget
A widget is an interactive component (usually graphical) that the browser uses to interact with a user. Ex: Buttons, drop-down menus, and data entry fields.
country code top-level domain (ccTLD)
Also, each country is assigned a unique two-letter country code top-level domain (ccTLD) like .uk (United Kingdom), .ru (Russia), and .de (Germany).
comment
An HTML comment is a portion of the document that is not displayed by the browser. A comment cannot be nested in another comment. A comment begins with the <!-- character sequence and ends with the --> character sequence.
HTML tag
An HTML tag is a markup instruction identified by <, a tag name, and a >.
request method
An HTTP request method indicates the desired action to perform on a resource.
status code
An HTTP response status code is a three digit number that indicates the status of the requested resource.
accessor property
An accessor property is an object property that has a getter or a setter or both
target
An anchor tag's target attribute indicates how the browser should display the link when clicked. _self, which is the default value for the target attribute, indicates the browser will open the link in the same tab or window. If the target attribute is _blank, the web browser will open the link in a new tab or window.
anonymous function
An anonymous function is a function that does not have a name. Anonymous functions are normally assigned to a variable so the function can be called, but an anonymous function can call itself when the anonymous function is declared.
array, elements, index
An array is an ordered collection of values called elements. Each array element is stored in a numeric location called an index. Array elements may be of the same type or different types. Arrays increase in size as elements are added and decrease as elements are removed.
associative array or map
An associative array or map is a data structure that maps keys to values. JavaScript objects can be used as associative arrays, in which the key is the object property and the value is the property's value.
Element
An element is a single HTML structure
exception, exception handling
An exception is an error that disrupts the normal flow of program execution. When an exception occurs,a program may need to execute code to handle the error. Ex: Display an error message, call a function, or shutdown. Exception handling is the process of catching and responding to an exception.
if-else statement
An if-else statement executes a block of statements if the statement's condition is true, and optionally executes another block of statements if the condition is false.
aspect ratio
An image aspect ratio is the ratio of the image width to the image height. The aspect ratio is written as width:height.
infinite loop
An infinite loop is a loop that never stops executing. If the web browser is running JavaScript that contains an infinite loop, the web browser tab will cease to respond to user input.
inline
An inline tag's content tries to fill the minimum space possible in the tag's parent container and can only contain text or other inline tags. For example, the <a> tag is an inline tag that creates a hyperlink container as big as the link's internal content; a hyperlink does not fill the width or height of the link's parent paragraph.
object
An object is an unordered collection of properties.
object literal
An object literal (also called an object initializer) is a comma-separated list of property name and value pairs
property
An object property is a name-value pair, where the name is a string and the value is any data type. Objects are often defined with an object literal.
opening tag
An opening tag indicates the starting point in the document where the tag takes effect. A closing tag indicates the ending point in the document where the tag stops having an effect.
unordered list
An unordered list is a collection of items, usually indented and shown using bullets, surrounded by the <ul> opening and closing tags.
information mesh
Another name for the web that was considered by the web's creator.
The color input picker
Clicking on the color input picker creates a color selector pop up that helps the user explore and choose a color. Requiring the user to enter a hex string such as #4268D3 into a text input field is confusing for most users, so the color picker introduces a large improvement. The basic syntax for the color input is <input type="color">.
Combinators
Combinators are CSS selectors that match specific relationships between other selectors. The descendant, child, adjacent sibling, and general sibling selectors are all combinators.
DOM
Document Object Model
ECMAScript
ECMAScript is the standardized language that has been improved over the years, and JavaScript is an implementation of ECMAScript. The latest version of ECMAScript is version 7 (ES7) and was released in 2016.
exponentiation operator
ES7 introduces the exponentiation operator **, which returns the result of raising the first operand to the power of the second operand. Ex: 2 ** 3 = 23 = 8
Each list
Each list item is surrounded by <li> opening and closing tags.
FTP (File Transfer Protocol)
FTP (File Transfer Protocol) was an early way for transferring files over the Internet. Users used FTP programs to connect to servers, look at listings of available documents, and download documents of interest.
A web browser will process the HTML following a script element that uses an external JavaScript file while the browser waits for the web server to return the JavaScript file.
False
IoT devices display one or more of the following characteristics:
Gather information about the physical world using sensors. Ex: temperature, voltage, images. Share the sensor data with control systems. Ex: A sensor may report a room's temperature to building control system, or air ozone and water pollution sensors reporting air quality data to urban environment monitoring systems. Interact with hardware to execute commands sent by control systems. Ex: Speed up fan moving hot air to part of a building where the sensed temperature is below the target temperature.
http
Hyperlink used to send requests and responses over the Internet without encryption.
https
Hyperlink used to send requests and responses that are readable only by the client and server.
ftp
Hyperlink used to transfer data files.
second-level domain
Immediately after a top-level domain comes a second-level domain, such as wikipedia in wikipedia.org. A second-level domain is commonly an organization's name as in Stanford.edu, or indicates the purpose of a website as in DoPython.org. ex: .gov
function expression
JavaScript functions may be assigned to a variable with a function expression. A function expression is identical to a function declaration, except the function name is omitted.
interpreter
JavaScript is executed by an interpreter. An interpreter executes programming statements without first compiling the statements into machine language. Modern JavaScript interpreters (also called JavaScript engines) use just-in-time (JIT) compilation to compile the JavaScript code at execution time into another format that can be executed quickly.
<kbd>
Keyboard input
What window object property is useful for determining if the web page is loaded using HTTPS or HTTP?
Location
Important mobile development topics.
Mobile First : A web development approach that advocates first creating a reduced-feature version of a website for mobile users. Then, the developer creates a full-featured website for visitors using desktop computers. Screen size: Physical dimension in pixels of a device's screen. Affordances: Visual clues that guide the user in figuring out how to use an app. Responsive web design: A web design approach that creates web pages that automatically move and resize parts depending on the display size and orientation.
lossless compression
PNG and GIF images use lossless compression, meaning no image quality is lost. Lossless compression works best when a large number of adjacent pixels are the same color.
Markup
Part of a document that explains how to interpret or structure other parts of the document.
Developers of mobile-friendly web pages need to consider the following concerns:
Screen size: Screen size is much smaller than desktops. Load speed: Mobile devices may have limited or slower Internet connectivity. Device speed: Limited memory and CPU speed of mobile devices means mobile browsers are not as powerful as desktop browsers. Data cost: Many users have data plans that limit how much content can be downloaded. Large web pages and web pages that keep requesting more data reach a mobile data plan's limit faster. Battery life: A web page that constantly runs JavaScript and frequently loads data will drain the battery faster. Interface: User interaction is with touch, not a mouse.
max
Sets the maximum value that the input can have. E.g. max="212" limits the input value to a maximum of 212. <input type="number" max="212">
Common HTTP response status codes.
Status code Meaning 200 HTTP request successful 3XX General form for request redirection errors 301 Resource permanently moved, the new URL is provided 4XX General form for client errors 400 Bad request. Ex: Incorrect request syntax 401 Unauthorized request. Ex: Not properly authenticated. 403 Request forbidden. Ex: User does not have necessary permissions. 404 Not found. Ex: Requested resource does not exist. 5XX General form for server error codes 500 Internal server error. Ex: Server-side code crashed. 503 Service unavailable. Ex: Web page is temporarily unavailable due to site maintenance.
Common HTTP response status codes.
Status code Status phrase Meaning 200 OK Standard response for a successful request. 301 Moved Permanently The resource should always be requested at a different URL. 302 Found The resource should temporarily be requested at a different URL. 304 Not Modified The resource has not been modified since the last time the resource was requested. 403 Forbidden The web server does not have permission to access the resource. 404 Not Found The resource could not be located. 500 Internal Server Error Something unexpected happened on the web server.
One script element can be used to include both inline JavaScript and a reference to an external JavaScript file.
TRUE ,A script element can either be used for inline JavaScript or an external JavaScript file.
<meta>
Tag specifies metadata, which is data that describes the document's data. <meta charset="UTF-8"> is a required meta tag describing how characters are represented in the HTML document. Additional <meta> tags may be used to indicate when the document was saved, who the author is, what language the page is written in, etc.
<meta charset = "UTF-8">
Tag that specifies the character encoding used in the document.
string concatenation operator
The + operator is also the string concatenation operator. String concatenation appends one string after the end of another string, forming a single string. Ex: "back" + "pack" is "backpack".
HTML5 forms provide pseudo-classes to help CSS styling of forms. The following are four examples of HTML5 pseudo-classes:
The :valid pseudo-class is active on an element when the element meets all the stated requirements in field attributes. The :invalid pseudo-class is active on an element when one or more of the attributes in the field are not fully met. The :required pseudo-class is active on an element if the element has the required attribute set. The :optional pseudo-class is active on an element if the element does not have the required attribute set.
<br>
The <br> tag creates a line break in a paragraph, such that the content after the line break appears on a new line. ex: line break is essential to the content, such as lines in a poem or mailing address
<cite>
The <cite> tag denotes a title, such a book or song title, and is italicized by default.
<em>
The <em> tags indicates emphasized text, such as text having an emphasized pronunciation when spoken, and is italicized by default.
<form>
The <form> tag allows the web browser to send information from the user to the server. The <form> tag has two primary attributes: 1) action 2)method
<i>
The <i> tags indicates text in an alternative voice, such as a word or phrase in a foreign language, and is rendered using italics.
<iframe>
The <iframe> element allows a web page to be embedded in a rectangular area of the current web page. The <iframe> element uses the src attribute to specify the URL of the web page to display and the width and height attributes to define the width and height in pixels of the rectangular iframe.
<mark>
The <mark> tag denotes content that is important and should be semantically highlighted and is rendered with a yellow background by default.
<option>
The <option> opening and closing tags create a value, or option, the user can select within a drop-down menu. When the user is not interacting with the menu, the drop-down menu usually displays the selected option.
<select>
The <select> opening and closing tags create a drop-down menu (or drop-down list), which allows users to select one of several predefined values.
<span>
The <span> tag is the generic tag for creating inline containers to facilitate managing content on the page. Unlike other inline tags, such as <a> and <em>, the <span> tag has no semantic meaning.
<strong>
The <strong> tags indicates text that has strong importance, and is bolded by default.
<style>
The <style> tag allows the web page to introduce presentational directives, usually CSS. A <style> tag is placed in an HTML document prior to the <body> tag, because the style section is designed to describe the presentation of the entire document. Although only needed for non-CSS content and rarely used, the <style> tag has an optional type attribute that describes the content inside the tag.
table datum.
The <td> opening and closing tags create a new table cell. Every cell in a table is contained within a table row. The word data is the plural form of datum.
table header
The <th> opening and closing tags create a new table cell information about the data. Usually, the browser will display the table headers centered with a bold font
Three optional table tags specify each part of a table
The <thead> tag specifies the table header. The <tbody> tag specifies the table body. The <tfoot> tag specifies the table footer. The <thead>, <tbody>, and <tfoot> tags do not affect the layout of the table, but browsers may use the tags to enable the table body to scroll independently of the header and footer or to print the header and footer on each page of a multi-page table printout.
<u>
The <u> tags denotes text that should appear differently from normal text, such as misspelled words, and is underlined by default.
<video>
The <video> element displays a video in a web page. The <source> element is used in a <video> tag to specify the name of the video file to play.
Internet
The Internet began as four networked computers in 1969 but is today the largest and most popular computer network, spanning the entire globe. Early versions of the Internet looked and acted similar to today, but in a much simpler way. Documents were plain text: no images, no formatting, and no interaction.
Web browsers support three popular image formats
The JPEG (Joint Photographic Experts Group) image format is commonly used for digital photographs. The PNG (Portable Network Graphics) image format is commonly used for line art and screenshots or images requiring transparency. The GIF (Graphics Interchange Format) image format is commonly used for simple animated images.
parseInt() and parseFloat()
The JavaScript functions parseInt() and parseFloat() convert strings into numbers. Ex: parseInt("5") + 2 = 5 + 2 = 7, and parseFloat("2.4") + 6 = 2.4 + 6 = 8.4. If parseInt() or parseFloat() are given a non-number to parse, the functions return NaN. NaN is a JavaScript value that means Not a Number. Ex: parseInt("dog") is NaN. The JavaScript function isNaN() returns true if the argument is not a number, false otherwise. Ex: isNaN("dog") is true.
Math.random() method, pseudo-random number
The Math.random() method returns a pseudo-random number between 0 and 1. A pseudo-random number is a number generated by an algorithm that approximates randomness, but is not truly random.
String method .charAt(index)
The String method .charAt(index) returns the character at the specified index as a string. Ex: "test".charAt(1) returns the character "e" at index 1
String method .indexOf(searchStr) , .replace(search, replacement)
The String method .indexOf(searchStr) searches for a string inside another string and returns the index of the found string. The .replace(search, replacement) method replaces one string with another and returns the string with the replacement string inside
String object
The String object defines methods to manipulate strings, extract substrings, test for string inclusion, etc. A string literal (a string in "quotes") is automatically converted into a String object when a String method is invoked
String property .length
The String property .length returns the number of characters in a string. Calling .charAt() with an index ≥ the string's .length returns an empty string.
adjacent sibling selector
The adjacent sibling selector, specified using a plus character (+) between two selectors, matches an element that immediately follows another element, where both elements have the same parent
.forEach()
The array method .forEach() is also used for looping through an array. The .forEach() method takes a function as an argument. The function is called for each array element in order, passing the element and the element index to the function.
array method .sort()
The array method .sort() sorts an array in ascending (increasing) order. .sort()'s default behavior is to sort each element as a string using the string's Unicode values. Sorting by Unicode values may yield unsatisfactory results for arrays that store numbers. Ex: 10 is sorted before 2 because "10" is < "2" when comparing the Unicode values of "1" to "2".
array, .indexOf(), .lastIndexOf()
The array methods .indexOf() and .lastIndexOf() search an array and return the index of the first found value or -1 if the value is not found. .indexOf() searches from the beginning of the array to the end. .lastIndexOf() searches from the end of the array to the beginning.
.length
The array property .length contains the number of elements in the array. The .length property is helpful for looping through an array using a for loop.
attribute selector
The attribute selector, specified with an attribute name and optional value comparison enclosed in square brackets ([ and ]), matches elements with the specified attribute or the specified attribute and value.
Background properties
The background-color property specifies the background color. The background-image property specifies a background image. The background property is shorthand for setting several of the element's background properties at the same time.
Box Model
The box model describes this space as nested boxes. The box model is useful and important to understand when considering design and layout. Content: The innermost box contains the content of the element, such as text and images. Padding: The padding box contains the content box and adds a transparent area around the content. Border: The border box contains the padded content and adds an optionally colored area around the padding. Margin: The margin box contains all three boxes and adds a transparent area around the border.
break, continue statement
The break statement breaks out of a loop prematurely. The continue statement causes a loop to iterate again without executing the remaining statements in the loop.
break statement
The break statement stops executing a case's statements and causes the statement immediately following the switch statement to execute. Omitting the break statement causes the next case's statements to execute, even though the case does not match.
child selector
The child selector, specified using a greater than character (>) between two selectors, matches any elements where the second element is a direct child of the first element. The child selector is similar to the descendant selector (space between selectors), but the matching child element in the child selector must be a direct descendant of the matching parent element.
class name selector
The class name selector, specified with a period character followed by the class name, matches elements that have the specified class name. Ex: .notice { color: blue; } selects all elements with a notice class attribute.
conditional operator (or ternary operator)
The conditional operator (or ternary operator) has three operands. If the condition evaluates to true, then the value of expression1 is returned, otherwise the value of expression2 is returned. ex. condition ? expression1 : expression2
The date input picker
The date input box displays a date input template and lets the user specify the date in one or more ways, including a popup date selector. The basic syntax for the date input is <input type="date">. Two attributes for the date input are min (the earliest date permitted) and max (the latest date permitted).
descendant selector
The descendant selector, specified with a selector followed by a space and another selector, matches elements that are contained in other elements. Ex: h2 em { color: blue; } selects em elements contained in h2 elements.
display property
The display property controls the layout of the element on a web page. Values for the display property include: inline displays the element as an inline element, like span or a elements. block displays the element as a block element, like p, h1, or div elements. none hides the element from being displayed, like style elements. inline-block displays the contents of the element as a block element, but formats the element as an inline element. list-item displays the contents of the element as a list item element.
do-while loop
The do-while loop executes the loop body before checking the loop's condition to determine if the loop should execute again, repeating until the condition is false.
element selector
The element selector matches elements with the specified element names. Ex: p { color: blue; } selects all p elements.
<h1>
The first level heading is surrounded by the <h1> opening and closing tags, and is appropriate for chapter titles.
Font properties
The font-family property specifies the font family, such as "Times New Roman" or serif. The font-size property changes the font size, such as 120%, small, or 12pt. The font-weight property specifies the font weight, such as normal or bold. The font-style property changes the text style, such as normal, italic, or oblique. The font-variant property specifies the variant of the text, such as normal or small-caps. The font property is shorthand for setting several of the element's font properties at the same time.
for-in, for-of
The for-in and for-of statements are used to loop through arrays. The for-in statement iterates over the index of an array. The for-of statement iterates over iterable objects like an array. ex. var nums = [2, 4, 6]; for (var i in nums) { console.log(i); // 0, 1, 2 } for (var n of nums) { console.log(n); // 2, 4, 6 }
for-in loop
The for-in loop iterates over an object's properties in arbitrary order for (variable in object) { body }
general sibling selector
The general sibling selector, specified using a tilde character (~) between two selectors, matches the second element if the second element occurs after the first element and both elements are siblings.
getter, setter
The get and set keywords define getters and setters for a property. A getter is a function that is called when an object's property is retrieved. Syntax to define a getter: get property() { return someValue; }. A setter is a function that is called when an object's property is set to a value. Syntax to define a setter: set property(value) { ... }.
identity operator ===, strict equality
The identity operator === performs strict equality. Two operands are strictly equal if the operands' data types and values are equal. Ex: 3 === 3 is true because both operands are numbers and the same value, but "3" === 3 is false because "3" is a string, and 3 is a number.
multiple selector
The multiple selector, specified using a comma (,) to separate selectors, matches all listed elements to apply a style rule.
non-identity operator !==
The non-identity operator !== is the opposite of the identity operator. Ex: "3" !== "3" is false because both operands are the same type and value, but "3" !== 3 is true because "3" is a string, and 3 is a number.
The number input
The number input ensures user input is a valid number. The basic syntax for the number input is <input type="number">.
IPv4
The original Internet Protocol, known as IPv4, has 32-bit addresses. 32 bits can represent 232 or about 4 billion unique addresses, originally believed to be more than would ever be needed;. But 4 billion is no longer enough
Cascading
The process of combining multiple style rules and resolving conflicts between those rules.
prompt()
The prompt() function prompts the user with a dialog box that allows the user to type a single line of text and press OK or Cancel. The prompt() function returns the string the user typed or null if the user pressed Cancel.
HTTP
The protocol for transferring files among computers via the web.
pseudo element selector
The pseudo element selector, specified with two colon characters (::) followed by a pseudo-element, matches parts of elements. The pseudo-element selectors allow styles to apply to the first line or first letter of text of an element or to text that is selected by the user, or allow additional content to be inserted before or after an element.
pseudo-class selector
The pseudo-class selector, specified with a colon character followed by a pseudo-class name, matches elements based on user behavior or element meta-information. Ex: :hover { color: blue; } selects elements under the mouse cursor.
The range input
The range input control allows the user to select a value by dragging a sliding control along the length of a line. The basic syntax for the range input is <input type="range">. Three commonly used attributes for the range input are the min, max and currently selected values.
HTML5 form validation attributes include:
The required attribute indicates that the field must have a value (text or selection) prior to submitting the form. The max and min attributes indicate the maximum and minimum values respectively that can be entered in an input field with ranges, such as a date or number. The maxlength and minlength attributes indicate the maximum and minimum length of input allowed by an input field. The pattern attribute provides a regular expression that valid input must match. The title attribute can be used to provide a description of valid input when using the pattern attribute.
<h2>
The second level heading is surrounded <h2> tags, and is appropriate for subchapter titles. The third through sixth level headings tags are <h3>, <h4>, <h5>, and <h6>. The <h4> through <h6> tags are rarely used except in legal or academic documents that contain sections within sections within sections
switch statement
The switch statement is an alternative to writing multiple "else if" statements. A switch statement compares an expression's value to several cases using strict equality (===) and executes the first matching case's statements. If no case matches, an optional default case's statements execute.
universal selector
The universal selector, specified using an asterisk character (*), matches all elements in the web page.
submit button
The web browser displays a submit button widget for an <input> tag with the type attribute of "submit", which sends the associated form's data to the server when clicked.
World Wide Web, or simply "the web".
The web involved three things: 1)Text files, known as HTML files, containing links to other text files. 2)A program, known as a browser, for viewing HTML files. 3)A set of rules, known as the HTTP protocol, for transferring HTML files among computers.
while loop
The while loop is a looping structure that checks if the loop's condition is true before executing the loop body, repeating until the condition is false. The loop body is the statements that a loop repeatedly executes.
width and height
The width and height attributes are optional attributes supported by <img> tags that tell the browser how many pixels the image should occupy. The actual image size may be different from the specified width and height, in which case the browser will resize the image for display.
Hoisting
Unlike traditional functions, function expressions are not hoisted. Hoisting is JavaScript's behavior of moving variable declarations to the top of the current scope. Because function expressions are not hoisted, using a variable before the variable is assigned to a function expression causes an exception
local scope, local variable
Variables declared inside a function have local scope, so only the function that defines a variable has access to the local variable
global scope, global variable
Variables declared outside of a function have global scope, and all functions have access to a global variable
conditions affecting web accessibility include:
Visual problems like blindness, low vision, or color blindness Hand control issues ranging from tremors to total inability to use hands Seizures caused by flashing on screen Cognitive challenges like dyslexia and other difficulties in processing web pages
When web pages are built so as to cleanly separate document structure, visual layout, and interaction, the following results are obtained:
Web pages are more likely to work as intended across a wide range of browsers. Web pages work better on smartphones and other mobile devices. Internet of Things systems are easier to build because relevant data is easier to identify. Web accessibility is improved. Intelligent systems can extract more meaning from the content of web pages.
JavaScript
a programming language that enables a web page to have flexible behavior by specifying actions to be taken when events happen in the browser.
responseType
attribute is set by the programmer to let the browser know the expected response data format. ex: If the responseType attribute is set to "json", then the browser parses the entire response as a JSON object and sets the response attribute to the JSON object. If the responseType attribute is either "" or "text", the browser leaves the response unprocessed, and the response attribute contains the same value as responseText. If the responseType attribute is "document", the browser assumes the response is an XML document, and the response attribute contains the same value as responseXML.
checked
attribute that is a boolean value indicating whether the user has chosen a particular checkbox or radio button.
value
attribute that is associated with the user-entered text.
Common CSS properties.
background-color:Element's background color ex: h1 { background-color: lightgray; } font-family Font used for the element's text. ex: p { font-family: arial; } font-size: Font size used for the element's text. ex: p { font-size: 9pt; } padding: Spacing between element's content and border. ex: strong { padding: 5px; } margin: Spacing around element (outside element's border). ex: p { margin-left: 10px; } Note: margin-top, margin-bottom, margin-left, and margin-right specify margin for individual sides.
JSON value
can be one of seven possibilities: a JSON object, a JSON array, a string, a number, a boolean (true, false), or null.
whitespace
character is an unprinted character such as the spaces between words and lines of text. Browsers treat all sequences of whitespace as a single space between non-whitespace characters
HTML validator
checks that an HTML document conforms to the standard.
<!DOCTYPE html>
declaration instructs the web browser about what type of document follows.
caption
defines a short descriptive text for a table. The caption is surrounded by the <caption> opening and closing tags and must immediately follow the opening table tag. Usually, a web browser renders the table caption centered above the table.
console.log()
displays informational data to the console.
deprecated
feature is part of a language that is officially discouraged because newer or better features exist, or because the deprecated feature is no longer considered safe. Ex: W3C documentation states that <center> should not be used.
p { background-color = blue; } valid or invalid???
invalid, A rule declaration uses the colon to separate the property from the value.
Quirks mode
is a browser rendering mode that renders a web page using non-standard layout rules emulating older web browsers.
section
is a collection of related paragraphs, images, and other content organized into units such as chapters, subchapters, tabbed content in a tabbed container, and numbered sections of a thesis. Sections are surrounded by the <body> and <section> tags, or are implicitly created using a heading tag. A subsection is a section nested within another section. The section wrapped in <body> tags is the top-level section of the web page. All other sections wrapped in <section> tags are considered subsections.
UTF-8
is a common character encoding that describes characters used by most of the world's languages. UTF-8 even includes fictional languages (e.g., Klingon, elvish ) and emoji (e.g., 😀, ✈ )
absolute URL
is a complete URL. Ex: <a href="http://example.com/test.html">test</a> is a hyperlink using the absolute URL http://example.com/test.html.
web server
is a computer (or software running on a computer) that serves web pages to web browsers.
IP address
is a computer's unique address on the Internet (like a house's unique address in the world), usually represented numerically like 198.51.100.7.A typical IP address is 32 bits, divided into four 8-bit groups, each group often written as a decimal number.
web page
is a document that is viewed in a web browser.
nested list
is a list within a list item of another list. The entire nested list is indented and uses a different bullet.
cell
is a location in the table at a specific row and column.
window.location
is a location object that contains information about the window's current URL. Ex: window.location.hostname is the URL's hostname.
entity
is a mechanism for writing special characters or symbols in HTML, such as mathematical symbols, characters in most languages, and many other symbols.
HTTP request
is a message sent from the web browser to the web server. Often the request asks the web server to send back a web resource like an HTML file, image, CSS style sheet, JavaScript file, or video.
HTTP response
is a message sent from the web server back to the web browser in response to an HTTP request. Often the response contains the requested web resource.
domain name
is a name for an IP address, such as the name wikipedia.org for the IP address 208.80.154.224; the name is easier to remember and type.
JavaScript function
is a named group of statements that can be run by referring to that name.
window.navigator
is a navigator object that contains information about the browser. Ex: window.navigator.userAgent returns the browser's user agent string.
HyperText Transfer Protocol (HTTP)
is a networking protocol that runs over TCP/IP and governs communication between web browsers and web servers.
web browser
is a program that downloads an HTML document from a server, displays the document to the user with the appropriate formatting, and allows the user to interact with the document, such as clicking hyperlinks to access other documents. A web browser uses HTML to understand the structure and semantics, or meaning, of the document.
Transmission Control Protocol/Internet Protocol (TCP/IP)
is a protocol suite that governs how packets of data are transferred over the Internet from one machine to another. Understanding the details of TCP/IP is not usually required of web developers, but a thorough understanding of HTTP is necessary to create effective web applications.
HTTPS
is a protocol that encrypts HTTP traffic between a browser and web server so a network sniffer cannot intercept sensitive information in the HTTP traffic like passwords, credit card numbers, financial transactions, etc.
cross-origin HTTP request
is a request made to another domain.
ordered list
is a sequenced collection of items, usually indented and shown using numbers or letters, surrounded by the <ol> opening and closing tags. As with an unordered list, each list item is surrounded by <li> opening and closing tags
API (Application Programming Interface)
is a specification of the methods and objects that defines how a programmer should interact with software components.
Ajax (Asynchronous JavaScript and XML)
is a technique to asynchronously communicate with a server and update a web page once the response is received, without reloading the whole web page
URL shortening
is a technique to create shorter URLs that redirect to longer URLs. Ex: http://en.wikipedia.org/wiki/URL_shortening has a short URL of http://tinyurl.com/urlwiki.
HTML (HyperText Markup Language)
is a textual language for creating web pages
attribute
is a value that provides additional information about a particular tag and is included after the tag name but before the > in the tag. Each attribute has a name and a value, specified using the form name="value". Ex: <meta charset="UTF-8"> has an attribute named charset with value "UTF-8".
radio button
is a widget for input elements with the type attribute of "radio", which allows users to select exactly one value from possibly many values. The web browser groups radio buttons together with the same name attribute, where each possible value in a group has an associated input. When submitting a form, the browser sends the selected radio button's name and value attribute. Ex: If the radio button <input type="radio" name="movie" value="ET"> is selected, "movie=ET" will be sent in the HTTP request.
table
is an HTML structure surrounded by the <table> opening and closing tags that allows data to be organized in rows and columns.
browser cache
is an area on the computer's disk where web content can be stored by the web browser for quick retrieval later. By caching web content, browsers can reduce the amount of network traffic required to display previously visited web pages.
void element
is an element that only needs an opening tag. Other void elements include <img> for displaying an image and <input> for obtaining user input.
entity tag (ETag)
is an identifier for a specific version of a web resource. Ex: 34905a3e285dd11.
node
is an individual object in the DOM tree.
non-breaking character
is an inter-word character that permits treating the words on both sides to be one word.
XMLHttpRequest
is an object for communicating with web servers using Ajax. Using the XMLHttpRequest object allows web browsers to hide the communication latency and continue to provide a responsive user interface while waiting for a server response. The XMLHttpRequest object defines handlers for events that occur during the request/response cycle.
upload attribute
is an object for monitoring the status of the request being sent to the server. The upload attribute has the same handlers as the XMLHttpRequest object, but the progress handler is the only handler typically used for the upload attribute. The progress handler can be used to monitor the status of uploading large files, such as attaching a document to a Gmail message.
JSON array
is an ordered list of zero or more JSON values separated by commas and enclosed within brackets ([]). Ex: [], [13,"blue"].
JSON object
is an unordered list of zero or more name/value pairs separated by commas and enclosed within braces ({}). A name in a JSON object must be a string in double quotes. A value can be any legal JSON value. Each name and value is separated by a colon. Ex: { "Name": "Joe", "Age": 35 }
parent container
is any container within which other containers are located.
container
is any part of a web document body that has opening and closing tags.
web resource
is any retrievable item, like an HTML file, image, video, CSS style sheet, etc.
loadend handler
is called after the browser receives the response. The loadend handler is called upon both response success and failure, and is called after all other XMLHttpRequest handlers.
timeout handler
is called if the browser takes too much time to fully receive a response to a request. The timeout is an optional value that can be provided before the request is made. By default, the browser does not provide a timeout for a request.
progress handler
is called one or more times while a response is being received by the client. Progress handlers are called before result handlers. The progress handler can be used to provide a data download progress indicator to the user. A similar handler is available to provide an indicator for uploaded data.
loadstart handler
is called when the browser begins to send a request. The loadstart handler is called before any other XMLHttpRequest handler.
error handler
is called when the browser does not receive an appropriate response to a request. Ex: The browser is unable to connect to the server, the connection between browser and server is cut in the middle of a response, etc.
abort handler
is called when the browser is told to stop a request/response that is still in progress. Ex: The user closes the web page that made the request.
load handler
is called when the exchange between the browser and server has completed. From the browser's perspective, the server received the request and responded. However, the request might not have been successful because of a problem such as a non-existent web page. The HTTP status code must be examined to check which type of response was received. Ex: 200 vs. 404. The load, error, and abort handlers are mutually exclusive and are called after any progress handlers.
browser plug-in
is software that can properly read and interpret a file format that the browser cannot. Ex: The Flash Player plug-in allows a browser to play Flash files. Plug-ins have traditionally been a source of security risks for web browsers, and some browsers have stopped supporting some types of plug-ins.
obfuscator
is software that converts JavaScript into an unreadable form that is very difficult to convert back into readable JavaScript. Developers obfuscate a website's JavaScript to prevent the code from being read or re-purposed by others. Obfuscated code may also be minified and appear in a ".min.js" file.
network sniffer
is software that monitors network traffic and allows users to inspect HTTP requests and responses.
markup
is special markings in the document that provide additional information about links, formatting, and images.
table row
is surrounded by the <tr> opening and closing tags and contains all the cells within a table row.
Hypertext
is text that has links to other text (and today to images, videos, and more).
responseXML attribute
is the XML DOM version of the response. The responseXML attribute is only available as a DOM object if the response is a valid and correctly formatted XML document.
Web accessibility
is the ability of users with disabilities to access and use a web page with reasonable effort. Designing accessible web pages ensures equal access and opportunity for everyone.
paragraph
is the basic unit of text in an HTML document
statusText attribute
is the descriptive text describing the status attribute.
Separation of concerns
is the design principle of breaking up web content using distinct languages and documents that overlap as little as possible. In modern web design, document structure and text, visual layout, and page interaction are separately specified using three key languages. HTML is the language that describes the page content. CSS is the language that describes page layout. JavaScript is the language that provides interactive functionality.
HTML5
is the fifth major revision of the HTML standard and is recommended for use by the W3C. HTML5 contains many new and useful features, so most new web page development uses HTML5.
Linkrot
is the general name for once valid links that now return 404 status codes.
Internet of Things
is the global collection of communicating devices that sense and control technology on behalf of humans. IoT devices range from a simple temperature sensor to a satellite-based laser scanner used to discover archaeological sites hidden by vegetation.
URL (Uniform Resource Locator)
is the location of a web resource on the web, such as http://www.cdc.gov/alcohol/faqs.htm.
status attribute
is the numeric status code returned in the response.
World Wide Web Consortium (W3C)
is the official organization that defines web standards, including HTML and CSS
responseText attribute
is the plain text version of the the response.
Minification or minimization
is the process of removing unnecessary characters (like whitespace and comments) from JavaScript code so the code executes the same but with fewer characters. Minification software may also rename identifiers into shorter ones to reduce space. Ex: var totalReturns = 10; may be converted into var a=10;.
response attribute
is the response body, which is parsed by the browser according to the responseType attribute.
HyperText markup language (HTML)
is the standard markup language for web documents. The language used for a text file that describes a web page. Specifies document structure is a textual language for creating web pages.HTML files are usually saved with a .html or .htm file extension. Ex: index.html. A
Cognitive computing
is the use of artificial intelligence techniques and access to vast amounts of data to simulate human problem solving in complex situations with ambiguity, changing data, and even conflicting information.
reviver function
is used to modify parsed values before being returned, and is helpful when a JSON string represents a data type not available in JSON. Ex: A reviver function can convert a string representing a date, "2010-12-30", to a JavaScript Date object.
browser redirect
is when the web server returns a 301 or 302 status code with a Location header indicating the URL the browser should load next.
preventDefault()
method on the event to cancel the form submission and prevent the form data from being sent to the server.
<body>
opening and closing tags enclose all elements and content to be rendered in the browser. HTML content displayed by the browser.
<html>
opening and closing tags enclose everything but the <!DOCTYPE html> declaration .
<title>
opening and closing tags enclose the name of the document. The title is usually displayed in the titlebar of the browser, is used by search engines, and is used for bookmarking
window.open()
opens a new browser window. Ex: window.open("http://www.twitter.com/") opens a new browser that loads the Twitter web page.
readystatechange handler
relates to any change in the XMLHttpRequest. many Ajax examples on the Internet only use readystatechange and do not include other handlers. Load, error, abort, and timeout are replacements for readystatechange.
Common HTTP request methods.
request method GET-Request a representation of the specified resource. HEAD-Request a response identical to GET but without the response body. POST-Request the web server accept the message body enclosed in the request as a new resource. PUT-Request the web server accept the message body enclosed in the request as a modification of an existing resource. DELETE-Request the web server delete the existing resource.
document.getElementsByClassName
returns an array containing all the DOM nodes whose class attribute matches the method's parameter. Ex: document.getElementsByClassName("traditional") returns an array containing the ol node with the class attribute matching the word traditional.
document.getElementsByTagName
returns an array containing all the DOM nodes whose type is the same as the method's parameter.
document.querySelectorAll
returns an array of containing all the DOM nodes that match the CSS selector passed as the method's parameter.
document.querySelector
returns the first element found in the DOM that matches the CSS selector passed as the method's parameter. document.querySelector expects the same types of parameters as document.querySelectorAll, but only returns the first element found while navigating the DOM tree in a depth-first traversal. Ex: document.querySelector("li") returns the li node about Fortran.
isNaN(num)
returns true if the parameter, num, is not a number.
RGB (or RGBA) color value
rgb(red, green, blue) function by indicating the red, green, and blue intensities. Each intensity for red, green, and blue is between 0 and 255, where 0 is the lowest intensity and 255 is the highest. 'A' being alpha.
password field
s a widget for input elements with the type attribute of "password", which allows users to enter a password without the password contents being displayed on-screen. Web browsers usually provide facilities to remember passwords at various websites to help users.
JavaScript Object Notation, or JSON,
s an efficient, structured format for data based on a subset of the JavaScript language. JSON (pronounced "Jason") is intended to be easily readable by humans and computers.
document.documentElement
s the root of the DOM tree (the "top" node). Each tag in an HTML file is associated with an object in the DOM tree
CSS rule
selects specific HTML elements and specifies styling properties for the element.
relative URL
specifies the relative path to the web resource with no scheme or hostname. Ex: <a href="test.html">test</a> uses the relative URL test.html to refer to an HTML document on the same website and with the same path as the current HTML document.
<img>
tag displays an image in a web page. The <img> tag does not enclose any content and consequently does not have a closing tag.
console
that allows the JavaScript code to produce informational and debugging output for the web developer, which does not affect the functionality or presentation of the web page. By default, the console is not open for viewing on a page. The console is viewable in Chrome by pressing Ctrl+Shift+J in Windows/Linux or Cmd+Opt+J on a Mac.
parentNode
that refers to the parent element containing the node. HTML attributes are represented in the DOM as similarly named properties on the corresponding node. Ex: The HTML title attribute becomes the node's title property in the corresponding node.
String methods .substr() and .substring()
the String methods .substr() and .substring() both return a substring from the String object. .substr(startIndex, [length]) has two parameters: the starting index and the optional length of the substring. .substring(startIndex, [lastIndex]) has two parameters: the string index and the optional index of the last character not to include in the substring.
enctype
tribute of "multipart/form-data" indicates the web browser should split a POST request into multiple parts, where each input field is sent as a separate part of the HTTP request message.
The DOM only refers to the HTML portions of the document.
true
Window object properties or methods can be accessed without putting window. in front of the property or method.
true
document.writeln("<div>test</div>") adds a div element to the DOM.
true
h1 { color: black; } valid or invalid???
valid, The CSS has a selector (h1), an opening brace, a rule declaration, and a closing brace.
What window object property likely produces the following output? document.writeln(window.______);
window.navigator.userAgent is the browser's user agent, which differs between browsers. window.navigator.language returns the browser's language. Ex: en-US for US English.