(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:
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. 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). | |||