We need you!

We're working hard on the next version of Developer Fusion. Let us know what you think we should be up to!

Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Rated
Read 113,656 times

Related Categories

Building a MultiDimensional Array in Javascript

davepamn

Building a MultiDimensional Array in Javascript The MultiDimensional Array
is zero based.  In the following example the array range is [0..6][0..1].


Implementation:

var sDataArray=MultiDimensionalArray(7,2);
alert(sDataArray[0][0]);
Code
function MultiDimensionalArray(iRows,iCols)
{
var i;
var j;
   var a = new Array(iRows);
   for (i=0; i < iRows; i++)
   {
       a[i] = new Array(iCols);
       for (j=0; j < iCols; j++)
       {
           a[i][j] = "";
       }
   }
   return(a);
}

NishiSoft provides Part I of the Information Technology Project collaboration. Sign up and list your IT project tasks, assign task too friends, and get percent complete task. Part will include a work order system with NishiSoft acting as the middle man between software task order, verification of requirements meet and services delivered, and generation of the voucher for payment between parties.

Comments

  • Filling a JS array from database with PHP

    Posted by michael301080 on 02 Aug 2002

    Hello,

    I 'ld like to know how you can fill such a multidimensional array with a recordset from a MySQL database.

    I can fill a selectbox with a query result with PHP.
    Now what I want to do is ma...