I need to do an HTTP GET request in JavaScript. What's the best way to do that?
I need to do this in a Mac OS X dashcode widget.
dashcodehttp-getjavascript
I need to do an HTTP GET request in JavaScript. What's the best way to do that?
I need to do this in a Mac OS X dashcode widget.
Best Answer
Browsers (and Dashcode) provide an XMLHttpRequest object which can be used to make HTTP requests from JavaScript:
However, synchronous requests are discouraged and will generate a warning along the lines of:
You should make an asynchronous request and handle the response inside an event handler.