Question

I'm trying to load a combo with an enumerator from Translation API. But, I don't know how to iterate and get both the key and value of each item and show it to the user. Can anyone tell me how to do this???

The object I'm trying to access is google.language.Languages. It is built this way:

google.language.Languages{
'AFRIKAANS' : 'af',  
'ALBANIAN' : 'sq',  
'AMHARIC' : 'am',  
'ARABIC' : 'ar',  
'ARMENIAN' : 'hy', 
....
}
Was it helpful?

Solution

for(language in google.language.Languages)
{
    alert(google.language.Languages[language]);
}

?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top