I paste the complete error: 1. Uncaught TypeError: Cannot read property 'translations' of undefined *attivita.asp?clien=7460C&reset=1:428*<http://www.progold.com/eportal/modules/CRM_PG_NEW/attivita.asp?clien=7460C&reset=1>
1. translateText1*attivita.asp?clien=7460C&reset=1:428*<http://www.progold.com/eportal/modules/CRM_PG_NEW/attivita.asp?clien=7460C&reset=1> 2. (anonymous function) *https://www.googleapis.com/language/translate/v2?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&source=en&target=it&callback=translateText1&q=this%20is%20a%20translation%20test%20to%20check%20its%20functionality*<https://www.googleapis.com/language/translate/v2?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&source=en&target=it&callback=translateText1&q=this%20is%20a%20translation%20test%20to%20check%20its%20functionality> . // API callback translateText1({ "error": { "errors": [ { "domain": "usageLimits", "reason": "accessNotConfigured", "message": "Access Not Configured" } ], "code": 403, "message": "Access Not Configured" } } ); Il giorno venerdì 19 ottobre 2012 16:53:12 UTC+2, jgeerdes [AJAX APIs "Guru"] ha scritto: > It's really hard to say what's going on simply by looking at the code. Can > you provide a link to your page, working or not? That way we can wield some > debugging tools on the thing. Alternatively, you might want to use > WebKit/Chrome/Safari debugging tools or Firebug to check for error messages > in the server's response. The new version of the API, in general, provides > much more useful error messages than the old one did. > > It might also benefit you to post to the dedicated Translate API forum, > linked below: > > https://groups.google.com/forum/#!forum/google-translate-api > > Jeremy R. Geerdes > Generally Cool Guy > Des Moines, IA > > For more information or a project quote: > [email protected] <javascript:> > > If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan > Church! > > On Oct 19, 2012, at 7:41 AM, Marcin Mazanek wrote: > > Hello, > I tried to check the example from the api Google Translate page on my > domain (from referer restriction), I put this simple code, from google docs: > > <html> > <head> > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> > <title>Translate API Example</title> > </head> > <body> > <div id="sourceText">Hello world</div> > <div id="translation"></div> > <script> > function translateText(response) { > document.getElementById(" > translation").innerHTML += "<br>" + > response.data.translations[0].translatedText; > } > </script> > <script> > var newScript = document.createElement('script'); > newScript.type = 'text/javascript'; > var sourceText = > escape(document.getElementById("sourceText").innerHTML); > // WARNING: be aware that YOUR-API-KEY inside html is viewable by > all your users. > // Restrict your key to designated domains or use a proxy to hide > your key > // to avoid misuage by other party. > var source = ' > https://www.googleapis.com/language/translate/v2?key=*******&source=en&target=de&callback=translateText&q=<https://www.googleapis.com/language/translate/v2?key=AIzaSyBTiDt3z0xVZd52E6FbPO_fMjs0j6i_0cM&source=en&target=de&callback=translateText&q=>' > > + sourceText; > newScript.src = source; > > // When we add this script to the head, the request is sent off. > document.getElementsByTagName('head')[0].appendChild(newScript); > </script> > </body> > </html> > > > But I received na error in firebug: > > TypeError: response.data is undefined > > ...lementById("translation").innerHTML += "<br>" + > response.data.translations[0].tr... > > > I don't really know. What is wrong ? > > Could you help me? > > I will appreciate it. > > Marcin > > -- > 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] <javascript:> > To unsubscribe from this group, send email to > [email protected] <javascript:> > To view this message on the web, visit > https://groups.google.com/d/msg/google-ajax-search-api/-/SvXl3Q8hbEEJ > For more options, visit this group at > http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en > > > -- -- 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] To view this message on the web, visit https://groups.google.com/d/msgid/google-ajax-search-api/439c18e8-9171-4f9f-a7f4-af4f65894703%40googlegroups.com For more options, visit this group at http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
