All posts tagged ‘Programming’

File Under: Glossary

Hash

A hash, also known as an associative array, is a collection of data in which each piece of data has two components: a key and a value. Much like the hash at your local diner, JavaScript hashes go unordered: They’re not indexed by numbers. For example, if you wish to use JavaScript to put up a different GIF animation on your site every day of the week, you might throw all these animations into a hash associated to each weekday as a key. Then you would refer to the key day to invoke that day’s animation.

For example, in a normal array, you’d have:

  dinner[0] = "monkey brain";

  dinner[1] = "meatloaf";

But in a hash, you could use a string as the index:

  dinner["monday"] = "monkey brain";

  dinner["tuesday"] = "meatloaf";

File Under: Glossary

Hover

Much like standing behind your co-worker while she slaves away, hover implies standing by but not doing anything. In dHTML, it refers specifically to when the user has positioned her cursor over a link but not yet clicked anything. The style will not change if the cursor is simply passed over the link, but you can set an action to take place after a predetermined amount of hovering.

File Under: Glossary

Loop

A loop is like a programming thought. Say you’re a police officer using a radar gun to catch speeding motorists. If the speed limit is 55 miles per hour, you might say to yourself: “If a car makes my radar gun display a higher value than 55, I’ll pull them over, but until then I will continue to take readings. And perhaps snack on this cruller.” In programming, the statement of this loop would be the action (firing up your motorcycle and chasing the speeder), and the expression would be the evaluation of whether or not the passing car made your radar gun read higher than 55. This is an example of a “while” loop:

  while (carSpeed < 55) {

  carSpeed = readRadar();

  // note:readRadar() should return the latest carSpeed

}



pullEmOver();  // this will only execute once carSpeed is >= 55

File Under: Glossary

Object dHTML

In object-oriented programming, an object is a self-contained entity that consists of both data and manipulation procedures.

Similarly, HTML 4.0 includes the <OBJECT> element to extend HTML in order to make it more dynamic. <OBJECT> allows an author to download external data or programs into the current page. This element can be used to gather other pieces of information, including Java applets, ActiveX controls, and possibly dHTML. The long-term goal of the World Wide Web Consortium (W3C) is for the <OBJECT> element to become the only way to embed data, replacing the <APPLET> and <IMG> elements.

File Under: Glossary

Object JavaScript

An object is a self-contained hunk of JavaScript that includes properties, other objects, and associated functions. The associated functions of an object (typically functions that describe what the object is supposed to do) are known as the object’s methods. JavaScript terms such as method and object are derived from the world of object-oriented programming.