- Script1.01.html
/
(View source file)
- You use the script tags to include JavaScript code in an HTML document.
- Script1.03.html
/
(View source file)
- The noscript tag allow to include alternate content for
non-JavaScript browsers.
- Script1.04.html
/
(View source file)
- Document.write() creates HTML code.
- Script1.05a.html
/
(View source file)
- Within the preformated tag, document.writeln() adds a carriage return,
while specail characters allow for other formatting features.
Here we've hilighted the special characters.
- Script1.05b.html
/
(View source file)
- Comments are used to include helpful information in your scripts.
- Script1.06.html
/
(View source file)
- The alert command creates a simple dialog box.
- Script1.07.html
/
(View source file)
- A confirm dialog box allows you to ask the user questions.
- Script1.08.html
/
(View source file)
- Prompt() accepts arguments for the message to display and default text.
- Script1.09.html
/
(View source file)
- A variable stores the value assigned to it.
- Script1.10.html
/
(View source file)
- A string variable can be used to store user input.
- Script1.11.html
/
(View source file)
- You can use a confirm dialog box to store a user's Boolean
response in a variable.
- Script1.12.html
/
(View source file)
- You can assign a variable a number of octal, decimal, or hexadecimal
base. Regardless of which base you use, JavaScript outputs in base 10.
- Script1.13.html
/
(View source file)
- The final values of a and b are 99 and 100. The variable a is decreased
by one only after its original value is assigned to b.
- Script1.14.html
/
(View source file)
- You use the plus sign to combine multiple strings into one.
- Script1.15.html
/
(View source file)
- Assignment operators provide a shortcut to changing the value of a
variable.
- Script2.1.html
/
(View source file)
- Giving names to parts of your page makes it easier to refer to
them in JavaScript
- Script2.2.html
/
(View source file)
- You can use event handlers to trigger responses to user actions.
- Script2.3.html
/
(View source file)
- Here this is used to simplify the address of a form element.
- Script2.4.html
/
(View source file)
- You create instances with one of the constructors listed in table2.4.
- Script3.1.html
/
(View source file)
- You define your function's statements within braces.
- Script3.2.html
/
(View source file)
- You can use an event handler to trigger a function call.
- Script3.3.html
/
(View source file)
- You pass information to your functions in the form of arguments.
- Script3.4.html
/
(View source file)
- To use a function's results in the script, end it with a return
statment.
- Script3.5.html
/
(View source file)
- By resetting an event handler, you can change the function called
by a user event.
- Script3.6.html
/
(View source file)
- You can call a JavaScript function from any HTML link.
- Script3.7.html
/
(View source file)
- (Test in Netscape) JavaScript entities allow any expression to be used as an HTML value.
- Script3.8.html
/
(View source file)
- (Test in Netscape) The Function constructor provides a different way to define functions.
- Script3.9.html
/
(View source file)
- The caller property can refer to an event handler or function.
- Script3.10.html
/
(View source file)
- The arguments array stores all of the values passed to a function.
- Script4.1.html
/
(View source file)
- You can use a button click to trigger a part of your script.
- Script4.2.html
/
(View source file)
- Checked stores true if a radio button is selected,
false if it is not.
- Script4.3.html
/
(View source file)
- Using the checked property, you can select of a radio button
through your script.
- Script4.4.html
/
(View source file)
- Checked stores true if the checkbox is checked and false if it is not.
- Script4.5.html
/
(View source file)
- Blurring out of the first text fields copies its contents to the second.
- Script4.6.html
/
(View source file)
- By blurring a field when the user clicks on it, you can ensure that
the user doesn't write in it.
- Script4.7.html
/
(View source file)
- selectedIndex stores the index number of the selected menu item.
- Script4.8.html
/
(View source file)
- You can change the text of any item in a pull-down menu.
- Script4.9.html
/
(View source file)
- Depending on the type of menu you have created in HTML, you can
select items through selectIndex and options[].selected.
- Script4.10.html
/
(View source file)
- You can generate an entirely new menu item with the option constructor.
- Script4.10b.html
/
(View source file)
- You use the hidden object to pass information from on form to another.
- Script4.11.html
/
(View source file)
- The reset button can be scripted to give the user a second chance.
- Script4.12.html
/
(View source file)
- You can use a conditional statement to confirm a form submission.
- Script4.13.html
/
(View source file)
- By checking the value of the elements, your script can alert the user
to missing responses.
- Script4.14.html
/
(View source file)
- The fileUpload element allows the user to choose a file to be sent to
the server.
- Script4.15.html
/
(View source file)
- You can use the type property to determine the element which called a
function.
- Script5.1.html
/
(View source file)
- You can use confirm() as the condition of an if statement.
- Script5.2.html
/
(View source file)
- Comparaison operators determine the relationship between two values.
- Script5.3.html
/
(View source file)
- You can use a logical operator to make multiple comparaisons.
- Script5.4.html
/
(View source file)
- An if-else statement reads a second set of statement if its condition
is not true.
- Script5.5.html
/
(View source file)
- You can use else-if statements to make your script respond to more
than two conditions.
- Script5.6.html
/
(View source file)
- (Test in Netscape) You can use conditional expressions in place of an if-else statement
which returns a value.
- Script5.7.html
/
(View source file)
- You can use the while loop to repeat a group of statements.
- Script5.8.html
/
(View source file)
- When defining a for loop, you give information about a counter variable.
- Script5.9.html
/
(View source file)
- You can use the for in loop to cycle through the properties of
an object.
- Script5.10.html
/
(View source file)
- This seemingly harmless script will actually force the user to quit
her browser.
- Script5.11.html
/
(View source file)
- You can use a nested conditional to cycle through each of a
form's elements.
- Script5.12.html
/
(View source file)
- You should use the break statement in a conditional if you want to
work with the counter value elsewhere in your script.
- Script5.13.html
/
(View source file)
- A continue statement sends the script back to the top of the loop.
- Script5.14.html
/
(View source file)
- You can use with to save keystrokes.
- Script6.1.html
/
(View source file)
- You can use eval() to let the user enter numbers for your script.
- Script6.2.html
/
(View source file)
- You can use parseInt() and parseFloat() to convert text entered
by the user to a particular type of number.
- Script6.3.html
/
(View source file)
- ToString() converts numbers to strings.
- Script6.4.html
/
(View source file)
- Typeof tells you the data type of an expression as a string value.
- Script6.5.html
/
(View source file)
- The charAt method returns a single character from the string.
JavaScript numbers the first character as zero.
- Script6.6.html
/
(View source file)
- You can use methods of the String object to fromat text entered
by the user.
- Script6.7.html
/
(View source file)
- The indexOf method searches strings for a substring. This script
stores the index numbers for every occurence of the search term.
- Script6.8.html
/
(View source file)
- The split method divides a string into an array of strings.
- Script6.9.html
/
(View source file)
- A form validation function can check that data is valid before
submitting it.
- Script6.10.html
/
(View source file)
- To change the range of the random method, multiply by the range
and add the minimum value.
- Script6.11.html
/
(View source file)
- the Math object stores common mathematical constants.
- Script6.12.html
/
(View source file)
- The Math object allows you to perform math operations on your page.
- Script6.13.html
/
(View source file)
- JavaScript has a number of methods that round numbers.
- Script6.14.html
/
(View source file)
- The max method of Math returns the larger of two numerical arguments.
- Script6.15.html
/
(View source file)
- By rounding a random number and storing your image files by number,
you can include random graphics on your page.
- Script7.01.html
/
(View source file)
- You can use onLoad to avoid script references to page elements
not yet loaded.
- Script7.02.html
/
(View source file)
- You can use onerror to suppress error messages.
- Script7.03.html
/
(View source file)
- A for loop scrolls the window in ten-pixel increments.
- Script7.04.html
/
(View source file)
- By setting the status or defaultStatus property, you can display
messages in the window's status bar.
- Script7.05.html
/
(View source file)
- SetTimeout() makes JavaScript wait before reading the code you
specify.
- Script7.06.html
/
(View source file)
- You can display a scrolling message in the status bar
which moves from right to left.
- Script7.07.html
/
(View source file)
- You can use the color properties to change the coloring of your page.
- Script7.08.html
/
(View source file)
- The referrer property return sthe URL of the calling page.
- Script7.09.html
/
(View source file)
- JavaScript stores a page's links and anchors in arrays.