Want to use a google translate widget. I can add it to iFrame, but the iframe source is from a different domain so cannot translate the parent window (Corss origin). Kind of a dead end as far as I can tell. So how about from WIX Code? It seems to be a only a subset of jQuery/JavaScript is that right? How can I append elements to the main content with WIX Code?
You should be able to directly access the Google APIs. Read the article Accessing 3rd-Party Services and the wix-fetch API for more information. You can also play with a working Google Maps Places example which demonstrates how to interface to the Google APIs.
Oh okay, thanks. So basically you are saying I can re-implement the Google Translate widget functionality in Wix Code environment? I see technically that is possible, but would take days or weeks I think! How long would something like that take you, do you think? I thought if it was easy you would have provided it already.
The reason for this question is I was hoping to use the Google-provided and proven embed code from https://translate.google.com/manager/website/ that takes like 5 minutes to have fast and reliable content translation.
Hey there NotShirley,
That disadvantage of embedded code is that the API key (and other sensitive information) is hidden from inquisitive site visitors. Reference the links I provided above and check out the information provided by Google on how the REST interface for the translation web service.
Yisrael
There is no API key in the embed code… I know how Google REST API works, also. Sorry if I’m being vague, so is there a way to append elements in WIX code? I was able to do it with Custom Tracking Tool and Analytics sort of, but that seemed to only work on sites with a custom domain.
You can’t embed HTML in a Wix Code page. However, you be able to use the HtmlComponent . For more information, see the article Working with the HTML Component in Wix Code .