1) I have this Javascript array:
lang=new Array();
lang["sq"]="Albanian";
lang["ar"]="Arabic";
lang["en"]="English";
lang["ro"]="Romanian";
lang["ru"]="Russian";
2) In some other process, there is a returned value in a variable:
result.detectedSourceLanguage = 'en';
3) Now, i want to print the language full name by doing this:
alert(lang[result.detectedSourceLanguage]);
The dialog displays: undefined
Any ideas?
BTW: im using JQuery, so JQuery solutions are welcomed.