2009
Jun
04

Syntax errors are errors in grammar and punctuation such as mismatched quotes or missed commas. These errors are caught quickly if you have the browser's built-in error detector in display mode or run the script through jsLint. Runtime errors only show up as the script is executed. Common examples are calling a function that hasn't been declared (typing error or case-sensitivity issue) or division by zero. Although JavaScript is typeless, many built in objects expect and/or return specific types (eg. style.left needs string type).

2009
May
26

Cookies are small amounts of data stored by the web browser. They allow you to store particular information about a user and retrieve it every time they visit your pages. Each user has their own unique set of cookies. Cookies are typically used by web servers to perform functions such as tracking your visits to websites, enabling you to log in to sites, and storing your shopping cart.

2009
Apr
26

Netscape maintained that the event on element1 takes place first. This is called event capturing. The event handler of element1 fires first, the event handler of element2 fires last. W3C has very sensibly decided to take a middle position in this struggle. Any event taking place in the W3C event model is first captured until it reaches the target element and then bubbles up again.

2009
Apr
21

Dynamic Style LoadingExamplevar HTTPUTILITY = { getStyle: function(url, callback) { var isLoaded = false; var style = document.createElem...

2009
Apr
20

Here we set up two different event handlers on the newly created script tag. Depending on the browser, one or the other of these two handlers is supposed to be called when the script has finished loading. The onreadystatechange handler works on IE only. The onload handler works on Gecko browsers and Opera.

2009
Apr
17

Color is a subjective experience, it is a mental sensation, a reaction of our brain. We say that an orange is 'orange'. But is it really orange? How do we know? We cannot get outside of our eyes or brain to find out, but we do know that when the sun or light disappears; color vanishes. We take colors for granted. It's only when we are actually drawing or painting that we realize how much value color brings to our daily life.

2009
Apr
15

Disable Text SelectionWith CSSExample<div unselectable="on"></div> /* For IE */Example.text-selection { user-select: none; -moz-user-s...

2009
Mar
23

Private variables are declared with the var keyword inside the object, and can only be accessed by private functions and privileged methods.

2009
Mar
08

Opacity SettingWith CSSExample.opacity { opacity: 0.5; /* For Newer Mozilla Browsers, Safari, and Opera */ -moz-opacity: 0.5 /* For Older Mozilla Br...

2009
Mar
08

The background-image property allows you to specify an image to be displayed in the background. This can be used in conjunction with background-color, so if your image is not tiled, then any space that the image does not cover will be set to the background color. The path of the image is relative to the style sheet. So, in the following snippet, the image is in the same directory as the style sheet.