Hi All,
maybe my problem is related.
I tried to integrate google translate functionality in my webpage.
------------------------------------------------------------------------------------
caller function:
alert(callGoogle('book'));
or:
alert(String(callGoogle('book')));
------------------------------------------------------------------------------------
request function:
function callGoogle(translationString){ google.language.translate
(translationString, "en", "vi", function(result) {
if (!result.error) {
//google.language.ContentType='text';
alert('deep '+ result.translation);
//return String(result.translation);
return result.translation;
} else {
//alert('Key "' + langKey + '" is not defined!');
return 'koeln4711';
};
});
};
The "alert" works fine. I think It's a syntax problem with the
"function(result)". But I definitly need the result value direct from
the function to get it dynamicly written in my application (alert
makes no sence for me!).
On 11 Feb., 12:59, Ozberk <[email protected]> wrote:
> Hello Jamie
>
> Try this:
>
> {
> 'callback': function () {myFunction(term, region);}
>
> }
>
> Cheers,
> Ozberk
>
> On Feb 11, 4:32 am, js <[email protected]> wrote:
>
> > Hi All
>
> > Can anyone please tell me how to pass parameters to callback functions
> > when using the dynamic loading method?
>
> > I've read up onhttp://code.google.com/apis/ajax/documentation/#Dynamic,
> > searched a few places but can't find an answer. Note that I'm using
> > the "search" api (with gsc-search-box not displayed), not the
> > "maps" (as per the example). The parameters I want to pass are the
> > 'search term' and the users 'region'.
>
> > I'm assuming it's not possible to send parameters to the callbacks,
> > and that I'll have to either setup global vars, or read values from
> > hidden input boxes?
>
> > Any help/guidance would be appreciated.
>
> > Thank you in advance.
>
> > Jamie
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---