How to get contents of 3rd party website into javascript variable?


I am trying to write a little javascript program that runs on a local computer which will test if a website has high load or not.

So the javascript running on the Windows 7 computer needs to “call” a URL like this:

The “load.php” file just has output like this:


(This is the 1/5/15 minute load averages.)

How can I get this webpage file output into a javascript variable?


The HTML-People example from the Bulletproof Ajax code page is a good example of how that is done.

I was not able to figure out how to do this… Can anyone post some sample javascript code?

Basically… something similar to “get_file_content()” function in PHP.


page_value = get_file_content(;

Is this possible?

I also see at the microjs web site that there is an [URL=“”]Ajax section, inside of which is one called [URL=“”]MicroAjax that seems to do the job well.

That worked great. Thanks!