JavaScript : HTTP Get

I would like to grab website by JavaScript. I found the JavaScript library,
"request.js" (XmlHttpRequest Wrapper) from Demo here!

This is my JavaScript example to grab web page from

<script src="request.js"></script>

<span id="HttpContents">NO DATA</span>



 url: "",

 callback: getHttpContents,

 cache: Http.Cache.GetNoCache

}, [HttpContents]);

function getHttpContents(result,HttpContents){

 if (result.status==Http.Status.OK){

  HttpContents.innerHTML = result.responseText;

 } else {

  HttpContents.innerHTML = "An error occurred (" + result.status.toString()
+ ").";




just Developer note...


Anonymous said…
Thanx for your code! Works
Anonymous said…
How did this ever work?

The URL to request. Required. Note that due to security restrictions, the URL must point to the same server as the current page. You cannot use XmlHttpRequest to retrieve results from external servers directly.

According to the api and just copy/pasting your code it fails.

Popular posts from this blog

3G Bandwidth bonding solutions

docker - could not read CA certificate