Most Webpages that claim to be interactive, really mean you can click on hyperlinks to go to new pages. Even Webpages that have CGI scripts behind them don't really seem all that interactive: Fill out a form, hit the Submit button, and wait.
With JavaScript, a Webpage can really react to what you're doing. Images can swap when you move a cursor over them, form elements can influence each other on the fly, and calculations can be made without having to resort to a CGI script. Everything happens on your Webpage, utilizing the viewers computer to process changes. The viewer gets instant results.
One of the best things about JavaScript is that you can do a great deal with very little programming. You don't need a fancy computer, you don't need any software other than a word processor and a browser, and you don't need access to a Webserver; you can do all your work right on your own computer.
Even though it's simple to work with, JavaScript is a complete programming language, so as you learn more complicated JavaScript, you're also learning the basics of computer programming. If you want to move on to other programming languages, like Perl, C, C++, or Java, JavaScript is a great introduction.
Javascript Limitation
Javascript has one important limitation. It can't interact with local files. By design, Javascript only processes information that comes with it on the HTML page, or that the viewere inputs. If your application requires access to a database, or other files, they you have to use another program language like Perl with CGI.
Example Website JavaScript
Ok, here is a very simple example of a Javascript that you can use on your own Website. This is called an alert message. Go ahead and click the button labled 'JavaScript'. Then click the 'Ok' button.
Here is the code that does it.
<input type="button" value="JavaScript"
onclick="alert('JavaScript is cool');"
>
Note: This code has been placed on several lines to fit the paramiters of this page. If you use this JavaScript you can place it all on one line.
There are actually two parts to this code. One part is an HTML button tag, most of which is on the first line. The other is the JavaScript alert thing, (actually called an alert method). The third line is the closing tag or ']' that closes the button tag.
The Button code or tag, looks like this. In this example the button is labled 'JavaScript'. You can change Value to read anything you want. Just change the word 'JavaScript' to whatever you want the button label to read
<input type="button" value="JavaScript">
The other part of this code is the JavaScript, that reads like this:
onclick="alert('Javascript is cool');"
It gets placed inside the button tag. You can edit the words 'JavaScript is cool' to read anything you want. Just make sure to leave the quote marks.
DaySite Web Hosting
1400 North Beach Street Ormond Beach (Daytona), Florida 32174
386-589-5734 Web@DaySite.Net
Key Features
Secure Servers
Prof. Managers
Personal Support
Data Protection
Other Features
Super Connectivity
Ample Disk Space
Extensive Email
Spam Filters
Virus Filters
Web Site Stats
CGI, Perl, PHP
MySQL Database
SSL Directory
Free Domain Names