Monday, October 17, 2005

Array in Javascript


function Product(_headerName, _paramName) {
this.headerName = _headerName;
this.paramName = _paramName;
}


function pop()
{
var arrProduct = new Array();
arrProduct[0] = new Product("Product", "ProductFKID");
arrProduct[1] = new Product("Opening Stock", "OpeningStock");
arrProduct[2] = new Product("Stock Received", "StockReceived");
arrProduct[3] = new Product("Secondary Sale", "SecondarySale");
arrProduct[4] = new Product("Closing Stock", "ClosingStock");
arrProduct[5] = new Product("Stock in Transit", "StockinTransit");
arrProduct[6] = new Product("Damaged Stock", "DamagedStock");

for(var i = 0 ; i < arrProduct.length; i++)
{
alert(arrProduct[i].headerName +'-'+arrProduct[i].paramName);
}

}

No comments: