SageFix. LetsFix!  
Current Location : Home > Web Development > JavaScript > get array position? Share/Save/Bookmark    

Main Menu
SageFix - Let's Fix

Board Categories
    Web Site Designing
- Graphics
    Web Development
- .NET
- Classic ASP
- JavaScript
- PHP
    WebSite Management
- Promotion Techniques
- Search Engine Optimization
    Databases
- MySQL

Tutorials

Database Connection Strings

  Contact Us


 1 - 6 of 6 [Total 1 Pages]  
get array position?      Jul 23, 2002, 11:59 1
  
hi, i have an array like this in Javascript

var allLayersArray = new Array()
PHP Code:

 
      Jul 23, 2002, 13:01 2
  
Here ya go
Code:
function getLayerID(label)	{	for (var i=0; i<allLayersArray.length; i++)		{		if (allLayersArray[i] == label)			return i;		}	}var layerID = getLayerID('teams');

 
      Jul 23, 2002, 13:18 3
  
ah, thank you.

actually, i just remembered what to do seconds after posting, but thank you for helping though!

 
      Jul 24, 2002, 01:49 4
  
You should declare the array in one line though - to save
bytes.

Flawless

 
      Jul 27, 2002, 15:02 5
  
Quote:

You should declare the array in one line though - to save
bytes.
i.e.
Code:
var allLayersArray = new Array('teams','news','coaches','aboutus','rinks','hockeyinfo','supporters','credits');

 
      Jul 28, 2002, 05:42 6
  
Yes.

Flawless

 
 1 - 6 of 6 [Total 1 Pages]  









Subscribe to our mailing list
email


Current Location : Home > Web Development > JavaScript > get array position? Share/Save/Bookmark    

Development problem? SageFix is completely free -- paid for by advertisers and donations. Click here to Contact Us If you have any query. Enjoy!
Request processed in 0.00012 seconds Home - Contact Us - Terms Of Service - Privacy Policy - Copyrights - Top
Advertisements do not imply our endorsement of that product or service.
Current server time now is 14-Mar-2010 14:02:20
Copyright © 2009 Sagefix Inc. All rights reserved.
Powered By SageFix