Skip to content
Snippets Groups Projects
Commit f88943af authored by Arnaud Levy's avatar Arnaud Levy
Browse files

climate

parent dd2853c7
No related branches found
No related tags found
No related merge requests found
......@@ -31,14 +31,13 @@ window.osuny.translation = {
translate: function (field) {
'use strict';
var text = field.value,
var text = field.value,
xhr = new XMLHttpRequest(),
that = this;
xhr.open("POST", this.url, false);
xhr.open('POST', this.url, false);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function () {
if (this.readyState != 4) return;
if (this.status == 200) {
if (this.readyState === 4 && this.status === 200) {
var data = JSON.parse(this.responseText),
translatedText = data.translatedText;
that.translateField(field, translatedText);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment