JavaScript
First let me say that I'm just learning JavaScript, so I'm not an expert
or anything. First, JavaScript is a simple programming language which can
be added to HTML to enhance webpages. They deal with more object oriented
programming, which allows JavaScript to be alot more flexible than
HTML.
Why was JavaScript created? After years of working with HTML and creating
new tags and watching it morph to HTML4.0 and DHTML, many found that HTML
was just too limiting when designing a website. So JavaScript (in addition
to many other languages) was created to add new options to webpages.
Anyone can use JavaScript, yes, even beginning web designers. Thanks to
the many sites which offer JavaScripts for free and explain how to
implement them, people with little or no experience can add JavaScript to
their site.
JavaScript has opened many doors to the world of web design. Such features
as adding clocks, forms, password protection (not too powerful though),
mouseovers, menus, and many more have been unleashed since the creation of
this great languange.
Where do you place your JavaScript? Placing it is the same as HTML. You
find where you want it to show up or when you want it to load and you
place it in the appropriate place in the HTML file. To learn more about
JavaScript, check out out links page.
But I will teach you a little about JavaScript. It's an event driven
language. In other words, your JavaScript "program" won't execute until
the specified even happens. onLoad, onMouseOver, onMouseOut, onClick are
just a few events. Look down to bottom bar of your browser (it's called
your status bar). If you see the words 'Hi! How are you?' you're in good
shape. If you can't see it, well, you can still learn JavaScript. You
specify an event, by placing a JavaScript command inside an HTML tag.
Like this:
<a href="../images/colorbox.gif"
onMouseOver="window.status='The colorbox';return true;"
onMouseOut="window.status='';return true;">go look at this</a>
Here's an example of that:
go look at this
So, when the event (the mouse cursor points to the anchor) happens, the
command in the double quotes is executed. So, when the mouse goes over
the link, "window.status='The colorbox';return true;" happens. Which
means that the words "The colorbox" will appear in the status bar. Easy
enough. You can do onMouseOver, onMouseOut, and onClick for links. You
can do onLoad for the body tag, which will set the message in the status
bar when you load the page. Well, that's enough for you to chew over.
Next lecture