Cheap Tricks in JavaScript
By Lincoln D. Stein
I'm not the world's greatest fan of JavaScript, Netscape's browser scripting language. Despite its syntactic similarities to Java, it lacks many of the features that make the latter language so appealing to software developers. JavaScript is object oriented, but doesn't offer inheritance, true classes, or anything in the way of modules or libraries, which makes code reuse awkward. Development and debugging tools are very primitive, and because the source code for JavaScript programs is incorporated directly into HTML, there's no way to protect your hard work from people who want to "borrow" your ideas.
Although JavaScript is a drag on big projects, it really excels in the "cheap tricks" category; those quick and dirty programs that add a touch of class to your pages without much effort. In this column, I'll give a peek into my personal bag of cheap JavaScript tricks. No JavaScript knowledge is required -- just type the examples into your HTML code, and change the URLs and labels to your liking. These tricks will work with all versions of Netscape Navigator 2.0 and higher, and with Microsoft Internet Explorer 3.0 and higher.
Navigating with Buttons
Sick of coming up with clever wording for your hypertext links? Dissatisfied with the appearance of links wrapped around inline images?
|