Just about all programming courses start off with a simple program called "Hello World." This program outputs the text "Hello World," and it's designed to introduce you to the programming language and show you how to write, compile, and execute programs using that language.
In this tutorial, we'll build on what we learned with our first script by creating a variable and displaying its value on a web page instead of displaying static text.
In the previous tutorial, you learned how to create variables. Now, we are going to look at how those variables can be manipulated using operators.
This short quiz will test you on what you should have learned so far.
The IF Statement
Now that you know a little about operators, we'll look at couple more types of operators. These operators are commonly used in IF statements.
The CASE Statement
The CASE statement provides another means of selecting which code to process. While the IF statement allows two different paths, with the CASE statement you can have as many paths as you like.
This short quiz tests what you have learned about IF and CASE statements.
By using functions, you can reduce the length of your code and make modifying the code easier. Here, we explain how.
Variables do not necessarily exist for the entire time that your program is running. This tutorial explains when a variable starts and ceases to exist, and when it may be inaccessible even though it does exist.
You don't have to process the same variables each time you call a function. You can pass different variables to the function on each call using parameters.
Value of a Function
You can not only pass values to a function, but a function can also pass one back.
Test time again. This short quiz will help you assess what you have learned about functions.
Alert and Confirm
The Alert and Confirm built-in functions allow you to make messages pop up on the screen.
Finding and Fixing Errors
This short quiz will test your knowledge of the alert and confirm functions, comments, and finding and fixing errors.
This short quiz tests your knowledge of external scripts and the noscript tag.
Objects and Properties
Test time again. This short quiz covers objects and arrays.
In this tutorial, we look at how to get code to run more than once using the FOR statement.
The WHILE loop is even easier to use than the FOR loop, because it only determines when to terminate the loop. You just need to make sure that something in the loop at least has the potential to change what you are testing for.
This short quiz tests what you have learned about creating loops.
Date and Time
The Math class provides additional mathematical functions you can use. Unlike other classes, you don't need to define objects to be able to use the methods provided by the class. Instead, you can access them directly.
Any variable that you define as having a text value is automatically a string object, and all of the string methods can be applied to it.
Document Object Model
Internet Explorer DOM
Microsoft has included support for their own document object model in all versions of Internet Explorer since version 4.
When the standard DOM was introduced it was different to both the IE and Netscape ones. All current web browsers now support the standard W3C DOM.
Cross Browser DOM
By combining the code to access the three document object models together, we can often create scripts that will work on all browsers that support any of the document object models.
This short quiz tests what you have learned about the document object model (DOM).
Some people prefer to interact with web pages using their keyboard rather than a mouse. You may want to include event handlers to capture these events too.
This short quiz tests what you have learned about mouse and keyboard events.
Form Handling Events
If you have forms on your page, then you will want to perform processing when someone uses that form. Apart from the mouse and keyboard events already discussed, there are some additional events (and handlers) that only apply to forms.
If we create a global event handler, then we can intercept all occurrences of one or more specified events throughout the entire web page -- all without having to attach that event handler to any of the objects on our page.
What is the difference between what we have been looking at so far and true Object Oriented Programming?
This short quiz tests what you have learned about form, page, timed, and global events.
Putting It All Together