I\'ve got an array
var assoc_pagine = new Array();
assoc_pagine[\"home\"]=0;
assoc_pagine[\"about\"]=1;
assoc_pagine[\"work\"]=2;
This is not an Array. Better declare it like this:
var assoc_pagine = {};
assoc_pagine["home"]=0;
assoc_pagine["about"]=1;
assoc_pagine["work"]=2;
or
var assoc_pagine = {
home:0,
about:1,
work:2
};
To check if an object contains some label you simply do something like this:
if('work' in assoc_pagine){
// do your thing
};