December 5, 2006

Waiting for the DOM to Load

As we have started to learn about the DOM this season, one thing that is an issue when developing your scripts is knowing when you can have your scripts execute. Remember, the DOM is available to you only when it has finished loading in the browser. You may ask, when has it finished loading? Good Question!

(read more...)

November 27, 2006

Map APIs: Google Maps, Yahoo! Maps, Virtual Earth, MapQuest

Since the emergence of Google Maps giving us the ability to put an interactive map on your own web page(s), there are now four separate APIs to choose from: Google Maps, Yahoo! Maps, Microsoft Virtual Earth and MapQuest. These APIs are similar, so once you understand one; it is just a matter of learning the differences of the others.

(read more...)

November 8, 2006

Want a Cookie?

Cookies are really the only way in which you can share user data between two non-sequential web pages. Cookies allow you to store data on users’ systems and retrieve it in minutes, hours or even days later. This makes cookies perfect for remembering things like users' login names, which pages they visited last, what they dropped into their shopping carts and when they did so.

Although server-side code is the most robust method of dealing with cookies, sometimes you need to manipulate cookies on the client side. Luckily, JavaScript can read and write cookies in exactly the same way servers do. Though the problem with JavaScript is that reading a cookie requires a little parsing to get them out. Don't worry, I found a nice little function to the job for us.

(read more...)

November 7, 2006

Timers

Timers are a way to add a dynamic aspect to your web pages. They can be used to create animations, open or close windows, pop up a message to the user, and even destoy a cookie for security purposes.

There are two types of timers: one that's set once, and one that reoccurs over an interval. Both can be canceled, though the one-time timer method fires just once.

(read more...)

November 1, 2006

Is Random Really Random?

As random as random can be.

A computer cannot generate a truly random number because computation is deterministic: it follows an unbroken chain of cause and effect in which no truly random events ever occur. Instead, it uses a set of complex algorithms to generate what's known as a pseudorandom number --- a number that gives the appearance of randomness, and is good enough for any practical purpose.

(read more...)

October 21, 2006

October 06 Meeting - DOM Properties

Children, parents and siblings decribe the relationships for the current element in the DOM tree and whether it contains other elements or not.  Every node in the document has several properties such as nodeType which describes what the node is and nodeName which is the name of the elementor and finally nodeValue which is the value of the node, null if it is an element.

(read more...)

September 16, 2006

September 06 Meeting - The DOM

Every browser offers the document it displays for manipulation via something called the Document Object Model, or DOM for short.  Older browsers supported their own DOMs, but there is a standard one, defined by the W3C, that is supported by most browsers these days.

(read more...)

August 11, 2006

JavaScript Functions 101

A function is a self-contained block of statements. Functions are very good at holding reusable code. You can declare a function by using the function keyword followed by the name of the function you want to create:

function myfunction() {
     // do something
}

You execute the function like this:

myfunction();

(read more...)

« Previous Page Next Page »