var xhr = new XMLHttpRequest(); var url = 'https://learn.javascript.ru/xhr-crossdomain'; xhr.open('GET', '/test.php?url=' + encodeURIComponent(url), true); xhr.send();