Skip to content

Instantly share code, notes, and snippets.

@BMU-Verlag
Created December 19, 2019 16:53
Show Gist options
  • Save BMU-Verlag/1b5f201948e4b3694948d04b2c8ab330 to your computer and use it in GitHub Desktop.
Save BMU-Verlag/1b5f201948e4b3694948d04b2c8ab330 to your computer and use it in GitHub Desktop.
var url = "https://translate.yandex.net/api/v1.5/tr.json/translate?key=<API-key>&text=" + input + "&lang=" + languages;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log(this.responseText);
}
};
xhttp.open("POST", url, true);
xhttp.send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment