Skip to content

Instantly share code, notes, and snippets.

@psycalc
Created September 11, 2016 19:17
Show Gist options
  • Save psycalc/46994c78b3883bb78bc7bf284f674c81 to your computer and use it in GitHub Desktop.
Save psycalc/46994c78b3883bb78bc7bf284f674c81 to your computer and use it in GitHub Desktop.
atom possible google tranlate
url = "https://translate.google.com/?en=en#en/ru/#{cased}"
# Shell.openExternal url
xmlHttp = new XMLHttpRequest()
xmlHttp.open( "GET", url, false )
xmlHttp.onreadystatechange = ->
if this.readyState == 4
parser = new DOMParser()
doc = parser.parseFromString(xmlHttp.responseText, "text/html")
resultbox = doc.getElementById("result_box")
alert(resultbox.innerHTML)
xmlHttp.send( null )
console.log(xmlHttp.responseText)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment