I\'m currently developing a Greasemonkey script to translate fields in an Intranet app, using Google Translation API.
But some texts ar
As far as I understand it you can use jQuery to do cross domain requests like this...
function pass_ajax(url,text_to_translate){
$.ajax({
type: 'GET',
url: url,
crossDomain: true,
data: text_to_translate,
dataType: 'json',
success: function(data){
req = data; //here you can sanitize the data before concatenating
},
complete: function(xhr,textStatus){
translated_text += req;
}
});
The 'crossDomain: true' property is new to jQuery 1.5. Also, I think you could make use of success and complete and just concatenate the text as it returns, assigning it to a variable with outer scope.