JSFiddle - React, Tailwind, and code Playground

by Frank Liu

JavaScript

function httpGet(theUrl)
{
    var xmlHttp = new XMLHttpRequest();
    xmlHttp.open( "GET", theUrl, false ); // false for synchronous request
    xmlHttp.send( null );
    return xmlHttp.responseText;
}

var res = httpGet('http://www.hko.gov.hk' );
console.log(res);