Put HTTP get request response into variable

How do I put HTTP get request response into a variable?
I am using basic javascript XMLHttpRequest methods however I can seem to make the code return the response so that ui.vision can store it into a global variable.
Could someone please suggest some code snippet?

how can I use this code

url = ‘https://habr.com
const response = await fetch(url)
const result = await response.text()
console.log(result)

?
I am seeing this kind of error

Error in executeScript_Sandbox code: await is only valid in async functions and the top level bodies of modules

var xmlhttp;
try
{
xmlhttp=new ActiveXObject(“Msxml2.XMLHTTP”);
}
catch (e)
{
try
{
xmlhttp=new ActiveXObject(“Microsoft.XMLHTTP”);
}
catch (e)
{
try
{
xmlhttp=new XMLHttpRequest();
}
catch (e)
{
}
}
}

var bb;
xmlhttp.open(“get”,“url &t=”+new Date().getTime());
xmlhttp.onreadystatechange=function()
{
if(4==xmlhttp.readyState)
{
if(200==xmlhttp.status)
{
bb=xmlhttp.responseText;
}
}
}
xmlhttp.send(null);

Not cross platform, you try selewindow open+STORETEXT+SELEWINDOW TITLE