Site hosted by Angelfire.com: Build your free website today!




<BGSOUND loop="5" src="images/bluin.mid">





Go to Angelfire






Back to Main Page






E-Mail Me! Click Here!

Fun with Javascript
(Or: "Be a good lad and fetch me another cup of coffee")

One cannot help but run into java while browsing the internet today. These cute little scripts are litteraly everywhere (including a few places on this site). Do you remember the two lines on the first page of this site that greeted you based upon the time of day and told you what browser you were using? That's right...those are simple javascripts. Just in case you don't remember:

Writing your own javascript is very complex, and is well beyond the scope of this site, however the information is out there if you wish to learn. I would suggets a trip to your local bookstore; I used a couple books along the lines of the "for Dummies" series.

If you want to include java at first, I would suggest getting premade scripts from a source like javafile.com or earthweb.com. Such scripts are almost always free, provided you leave the credits to the author built into the script, and don't modify it.


Javascript picks up where HTML leaves off; and it really is what adds life to the internet. Think back to the glory days of Netscape 2.0, back in the Dark Ages when a fancy website was static text with a few animated images and a simple animated menu; oh yes, those were the days, but java is capable of so much more than that. I hear you clamoring for examples, so here they are:

  • Rotating images and text messages
  • Animated menus
  • Most banner ads
  • Pop-Up windows
  • Stock tickers and animated message boards
  • Transition effects between pages
  • Automatic Re-Directs
  • Passwords and Login Screens
  • Thousands of other examples I don't have time to list

When you get your hands on a javascript, there will usually be built-in instructions telling you where in you code to place it. Most scripts that create a small, local effect (such as a Stock Ticker) will be placed where you want them to appear on the page. Broad-scope javascripts (those that affect an entire page) are placed in the header of a page, between <head> and </head>. A few scripts have multiple components, and appear in both the page header and page body; an infamous example of this is a script that makes a section of text rainbow-coloured. Hard to figure out perhaps, but worth the reward, I believe.


Common bugs and errors

If you want to place the visible effect of a javascript inside a table, or in some other special location that is just fine, but make sure you put any tags that you are adding outside the javascript. The inventors of this somewhat cryptic language were kind enough to start and end all scripts with HTML tags; every script out there begins with <script> and ends with </script>. Truthfully, this is so that your browser can tell the difference between the two languages and shift gears, so to speak. If you accidentally place new tags inside the javascript, the entire thing will be ignored in every modern browser.

Similarly , if a script is placed where it cannot go on a page, it will be ignored. You may get a message in the bottom left of your browser that shows the page error icon and says "Done, but with errors on page". This should tell you that you need to debug your javascript(s).


Click a link below to jump to that page
Main Page Basic HTML Change Your Page's Colors
Changing Text Styles Changing Fonts Size, Face, and Color Centering, Line Breaks, Paragraphs, and more
Marquees Setting up Links & Hypertext E-mail Links
Building and Using Lists Special HTML Symbols Make Downloads Availible on Your Site
Headers and Title Lines Adding Graphics/Graphics as Links Basic Dividers
Adding Multimedia All About Tables Common HTML Errors
Customizable Forms Setting Up Your Page in FramesCascading Style Sheets
Fun with Javascripts