Array function only works first time?

:nono: Don’t understand why but this array function only works the first time arround. The idea is to send the array.join(’ ‘) with Ajax Get to server for pagination technique. uriencoded array.join(’ ') should be

  1. ‘art’
  2. ‘art’ ‘art’
  3. ‘art’ ‘art’ ‘art’

Not

  1. ‘art’
  2. ‘silver’ ‘art’
  3. ‘silvergold’ ‘silver’ ‘art’

Counter Function


function counter()
{
if(count.length==1)
{
return;
}
else if(count.length==2 && count[0]!==count[1])
{
count.shift();
alert(count.join(' '));//Demonstrate flaw
}
else if(count.length==3 && count[0]!==count[1])
{
count.shift();
alert(count.join(' '));
}
else if(count.length==3 && count[1]!==count[2])
{
count.shift();
count.shift();//should get rid of index 0 and 1, does first time?
alert(count.join(' '));
}
else if(count.length>3)
{
count.shift();//gaurenty max length of 3?
}
}

:xAny advice greatly appreciated.

:blush:OK. I have it working better. I had to call the function ‘counter()’ twice, once at the begining of the onclick then at the end. It seems to work like a dream now. Hope I can pass the array.join in the Get httprequest!!!:x