Archive for the ‘JavaScript’ Category
JavaScript is one of my favorite script (over 10 years). Â Javascript is client-side language in web applications world.
Actually is not a version of Java, but the syntax is very similar to Java language. In fact, Java and JavaScript are two completely different languages in both concept and design!
JavaScript was invented by Brendan Eich at Netscape (Navigator 2.0), and has appeared in all browsers since 1996.
Note: Client Browsers run JavaScript code.
JavaScript, also known as ECMAScript, is a prototype-based, object-oriented scripting language that is dynamic, weakly typed and has first-class functions. (see http://en.wikipedia.org/wiki/JavaScript)
Good resource for learning JavaScript:Â w3schools
JSON (an acronym for JavaScript Object Notation ) is:
- a lightweight text-based open standard designed for human-readable data interchange.
- a lightweight data-interchange format.
- easy for humans to read and write.
- easy for machines to parse and generate.
Good Reference: Â http://www.json.org/
This is a useful JavaScript function if you would like to show thousands separator (by comma [,]) in edit box:
Here is the code
function addCommaSeparator( value )
{
 var sRegExp = new RegExp('(-?[0-9]+)([0-9]{3})');
 while(sRegExp.test(value))
 {
 value = value.replace(sRegExp, '$1,$2');
 }
 return value;
}
Usage:
<INPUT TYPE="text" NAME="price" value="" onblur="this.value=addCommaSeparator(this.value)" Â size=10>



