JavaScript
  Home arrow JavaScript arrow Page 3 - An in depth discussion of JavaScript Array...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

An in depth discussion of JavaScript Arrays
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 9
    2006-02-28

    Table of Contents:
  • An in depth discussion of JavaScript Arrays
  • Working with single dimensional arrays: discussion
  • Working with two dimensional arrays
  • Working with two dimensional arrays: discussion
  • Another way to work with two dimensional arrays

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    An in depth discussion of JavaScript Arrays - Working with two dimensional arrays


    (Page 3 of 5 )

    In the above two sections, we only worked with single dimensional arrays (arrays with only one level of indexing).  Now, we shall deal with two dimensional arrays (arrays with two levels of indexing). 

    Now, let us try to develop a simple script (JavaScript) to declare and work with two dimensional arrays.  Have a look at the following code:

    <html>
          <head>
               <meta name=vs_targetSchema 
    content="http://schemas.microsoft.com/intellisense/ie5">
    <script id="clientEventHandlersJS" language="javascript">
    <!--
    function Show()
    {
          var ITArray = new Array(2300, 3105, 2909, 4800);
          var ProductionArray = new Array(1800, 1940, 2470, 4350);
          var ResearchArray = new Array(900, 1200, 1923, 3810);
          var salaryArray = new Array(ITArray, ProductionArray, ResearchArray);

          for (var i = 0; i < salaryArray.length; i++) {
                for (var j = 0; j < salaryArray[i].length; j++) {
                      document.write(salaryArray[i][j] + "\t");
                }
                document.write("<br>")
          }
    }

    function
    ButtonShow_onclick() {
          Show();
    }
    //-->
                </script>
          </head>
          <body>
          <form id="form1">
                      <input type="button" value="Show" id="ButtonShow" 
    name="ButtonShow" onclick="return ButtonShow_onclick()">
                </form>
          </body>
    </html>

    Actually, within the above code, the “meta” tag is not necessary.  As I developed the above code using Visual Studio.NET 2003 Enterprise Architect, it was automatically added to provide its full featured mechanisms.  The explanation for the above code is discussed in the next section.

    More JavaScript Articles
    More By Jagadish Chaterjee


       · I think "An In Depth Look" is a bit of a misnomer. This is more of an Introduction...
       · May be you are right. I should have given a better title. thanks for the...
     

    JAVASCRIPT ARTICLES

    - Using jQuery to Preload Images with CSS and ...
    - Using Client-Side Scripting to Preload Image...
    - Removing Non-Semantic Markup when Preloading...
    - Using the Display CSS Property to Preload Im...
    - Preloading Images with CSS and JavaScript
    - Scaling and Moving Web Page Elements with th...
    - Fading, Hiding and Sliding HTML Elements wit...
    - Toggling CSS Properties with the GX JavaScri...
    - Cancel, Queue and Pause Animations with the ...
    - Producing Elastic Effects with the GX JavaSc...
    - Moving Divs Diagonally with the GX JavaScrip...
    - Moving Elements Vertically and Horizontally ...
    - Making Bouncing Effects in Parallel with the...
    - Creating Bouncing Effects with the GX JavaSc...
    - Manipulating Background Colors with the GX J...







    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 11 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek