0

I am trying to hit an url which looks like http://localhost:8080/users/user_objects?_=1500026277756 using XMLHttpRequest().

var newjson;
var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
      newjson = this.responseText;
    }
  };
  xhttp.open("GET", "http://localhost:8080/users/user_objects?_=1500026277756", true);
  xhttp.send();
}

When the above code is run in the developer console of Google Chrome browser, the code works very well. But when the code is run inside the BIRT tool with Scripted Data Source as Data Source, its throwing an error. And the error doesn't say anything specific about it.

Kindly help me on this. An XMLhttpRequest() would be my preferred option to work with. If that's not possible, is there anyway to get the response data by hitting the URL?

I have also tried the ajaxRequest() and ActiveXObject("MSXML2.XMLHTTP.3.0") requests.

cuSK
  • 809
  • 11
  • 26
  • Have you read https://stackoverflow.com/questions/14220321/how-do-i-return-the-response-from-an-asynchronous-call – Musa Jul 19 '17 at 15:17
  • @Musa this explains how to get response using jQuery or ESCA standards. But in my case I need to get response using pure JavaScript and no external frameworks or plugins to be used. – cuSK Jul 24 '17 at 10:23

0 Answers0