Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (9.5k points)

Can anyone tell me how to do HTTP GET request in JavaScript in Mac OS X dashcode widget?

1 Answer

0 votes
by (19.7k points)

You can make use of the XMLHttpRequest object provided by browsers(dashcode) to make HTTP requests in JavaScript like below:

function httpGet(theUrl)

{

    var xmlHttp = new XMLHttpRequest();

    xmlHttp.open( "GET", theUrl, false ); // false for synchronous request

    xmlHttp.send( null );

    return xmlHttp.responseText;

}

Interested in Java? Check out this Java Certification by Intellipaat. 

Related questions

Browse Categories

...