HTML Goodies: Script Tip: Week 1

WEBINAR:On-Demand

JavaScript is a great computer language in that it is quite versatile and can be understood by the common Weekend Silicon Warrior. Here, we start off a series of tips to help you place JavaScript on your HTML pages.

We'll start with the basics. JavaScript offers the user a series of what it calls "objects." These are things that already exist without having to be created through scripting. This HTML page you're looking at is, in my opinion, the most commonly used object. In JavaScript speak, the page is named "document."

Okay, fine. You have an object, so what? Well, now you get to act upon it. These things that JavaScript uses to act upon "object" are called "methods." You can always tell a method by its tail. Every method has this at the end: ().

Those two parentheses denote the method and hold instructions on what should happen. For instance:

See what's happening? The document is being acted upon by the method "write." Inside the ( and the ) is what should be written to the page. In this case, green text.

You don't get a much more simple JavaScript than the one above. All it does is use scripting to place text upon the page. Whatever is in between those parentheses is written to the page. It's a very simple hierarchy statement.

Next Week: What do you mean by "hierarchy statement?"

Do YOU have a Script Tip you'd like to share? How about suggesting a Script Tip to write about? I'd love to hear it. Write me at: webmaster@htmlgoodies.com

Web Development Newsletter Signup

Advertiser Disclosure:
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.

Thanks for your registration, follow us on our social networks to keep up-to-date