PDA

View Full Version : getting the array number from the array value


emz
04-04-2007, 01:34 PM
i have a paging system that creates pages from a loop that loops through an array
the array is called list[]

function paging()
{
for(i=0;i<arr_length;i++)
{
document.writeln("<a style=cursor:hand; onclick=document.getElementById('frame').src='"+list[i]+"';><font face=arial size=2 color=white>Page: </font><font face=arial size=3 color=white><b>"+i+"</b></font></a><font face=arial size=5 color=white> |</font>");
}}

so my problem is i would like when someone goes to a page there is a textbox there which indicates his current page. is there a way i can get the array number from it value eg
if the array is

list[0]="index.htm";

when index is loaded how can i get from which array number it came from??

pliz heeeeelp!

Jon Hanlon
04-04-2007, 09:01 PM
You have to search the original array again for "index"