javascript - Google Translate API - No Access Control Origin with Text to Speech -
i posted question on google translate text-to-speech work.
google translate api text-to-speech: http requests forbidden
i told needed key , enable billing. i've since done that. know billing enabled because, using specified endpoint words-only translations (not narrated speech) (get https://www.googleapis.com/language/translate/v2?key=insert-your-key&source=en&target=de&q=hello%20world
), i'm able response both in dhc , in application $.get
:
in original question (above), told if api key, no longer blocked getting text-to-speech. tested request text-to-speech in dhc , postman:
https://translate.google.com/translate_tts?key=mykeyhere&ie=utf-8&tl=zh-cn&q=你好
and got 200:
excellent. however, in application, make get
request:
$.get('https://translate.google.com/translate_tts?key='+mykey+'&ie=utf-8&tl=en&q=hello+world', function (returned_data) {
i blocked:
no 'access-control-allow-origin' header
why this?
Comments
Post a Comment