<html>
<head>
<title>Simple XHR</title>
</head>
<body>
<h2>Simple XHR</h2>
<p>
<button name="XHR" onclick="loadData()">XHR</button>
<span>Status: </span><span id="status"> </span>
        <script>
         var loadData = function () {
var url = 'http://localhost:8082/filter-based/webapi/myresource';
         var req = new XMLHttpRequest();
         req.open('GET', url, true);
         req.onreadystatechange = function () {
         if (req.readyState == 4) {
                 document.getElementById("status").innerHTML = req.status;
         if (req.status == 200) {
         console.log('finished loading data');
         }
         }
         }
         req.send();
         };
        
        </script>
</body>
</html>