What is Ajax?

Ajax is shorthand for Asynchronous JavaScript and XML. Ajax is used primarly in web applications to get or post data on a web page without having to reload the entire page. It is utilized primarly as a usability technique. When used correctly, it can greatly enhance productivity for users of web applications as the wait [...]

JavaScript selectedIndex property

The selectedIndex property of a dropdown select list can be accessed via JavaScript as follows:
select name="SelectBox" onChange="alert(this.selectedIndex);"
The preceding example shows that selectedIndex is a property of the dropdown select list. selectedIndex is 0-based, meaning that the first item in the select list has a selectedIndex of 0; the second item in the select list [...]

Sun Names New Language JavaFX Script – Is this some sick joke?

As if it weren’t confusing enough explaining the difference between Java and JavaScript (which are unrelated), Sun Microsystems has muddied the waters further with the introduction of JavaFX Script. To quote from Sun’s website: “[JavaFX Script is] a highly productive scripting language that enables content developers to leverage the enormous popularity of Java to create [...]

JavaScript Versus Java: Differences and Similarities

What is the difference between JavaScript and Java? Actually, there is not much point in even discussing the similarities and differences because JavaScript and Java are unrelated languages.
JavaScript received it’s name from Netscape, who had originally developed the language using the name LiveScript, and changed its name at the last minute as a marketing move. [...]

JavaScript Switch Case Statement Example

The switch statement is used in JavaScript to evaluate cases for a variable and is used as follows:
var intTest = 1;
switch(intTest)
{
case 0:
document.write('0');
break;
case 1:
document.write('1');
break;
default:
document.write('unknown');
break;
}
The break statement exits the switch. If it is not used, subsequent cases will execute if also valid. For example, if no break was used in the case of 1 in the [...]

JavaScript Arrays Summary and Reference

Please see the links below which comprise my series on JavaScript arrays:
Creating a JavaScript Array
JavaScript Array length Property
JavaScript push Method: Adding to an Array End
JavaScript pop Method: Removing From an Array End
JavaScript split Method: Create Array from String
JavaScript join Method: Create String from Array
JavaScript splice Method: Array Add and Remove
JavaScript slice Method: Return Part of [...]

JavaScript: Open a New Browser Window

The JavaScript window object contains the open method. This can be used to open new browser windows via JavaScript, as follows:
window.open('url','windowname','options');
url is the path to the file to be opened in the new window
windowname is a variable reference to the opened window
options are the specifications of the opened window. The available options are:

height: The height [...]

JavaScript shift Method: Removing from an Array Beginning

The JavaScript shift Method can be used to remove elements from the beginning of an array.
//Removes 1 from the beginning of the array
var aryTest = [1,2,3,4];
aryTest.shift();
document.write(aryTest);
Related Articles:
JavaScript unshift Method: Adding to an Array Beginning
JavaScript push Method: Adding to an Array End
JavaScript pop Method: Removing from an Array End

JavaScript Array For Loop Example

The following code example demonstrates how to loop over a JavaScript array:
var aryTest = [1,2,3,4];
for (i=0;i<aryTest.length;i++)
document.write(aryTest[i]);
The length property of the JavaScript Array object is used to determine how many elements are in the array. These elements are then looped over, one-by-one, until all elements have been used, at which point the loop stops.
Related articles:
JavaScript Arrays [...]

JavaScript: Sort a List of Numbers

The following code can be used to sort a list of numbers in JavaScript:
function SortNumbers(a,b)
{
return a-b;
}
var lstNumbers = '20,25,5,15,10';
var aryNumbers = lstNumbers.split(',');
document.write(aryNumbers.sort(SortNumbers));
Related articles:
JavaScript Array Sort Method