Thanks for your help. I guess I should have explained what else I'm
trying to do.
I'm trying to translate values from an array and add the results to a
new array.
This is the script I tried:

google.load("language", "1");
$(document).ready(function(){
        var array = ["book","house","dog"];
        var array2 = [];
        var l = array.length;
        for(i=0;i<l;i++){
                function translate(){
                        var key = array[i];
                        google.language.translate(key,"en","ru", 
function(result)
{ array2[i] = result.translation; });

                }
        }
        alert(array2);
});


However, the alert comes back as blank. I can't really include it
within either of the functions because the for loop has to complete
first. Perhaps I'm still putting things in the wrong place. Is it
possible to do what I'm trying to do?

-- 
You received this message because you are subscribed to the Google Groups 
"Google AJAX APIs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-ajax-search-api?hl=en.

Reply via email to