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:

enter image description here

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:

enter image description here

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

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -