Such a problem: I wrote userscript for the site. In it, I need to get the contents of the file " https: //site/answ.txt " from another site. But I can't do it at all. Here is one of the many attempts to do this.
var x = new XMLHttpRequest(); x.open("GET", "https://site/answ.txt", true); x.onload = function (x) { var x = this.responseText; alert(x); } x.send(); read this article http://learn.javascript.ru/xhr-crossdomain . But still nothing happened