public

xhr()Method

Description

Start a XMLHttpRequest with the specified options.

Parameters

Type Name Description
String options the options to pass

Example

 nokia.mh5.require("nokia.mh5.xhr");

 var request = nokia.mh5.xhr({
     uri: "www.nokia.com", // required
     method: "GET", // optional, default is "GET"
     handler: function (response) {
         // handle response here...
         // it's either the response text itself or parse JSON if handleAs "JSON" was set as option
     },
     errorHandler: function () {
         // handle error (after we got status 0)
     },
     sync: false // optional, default is asynchronous
     // handleAs: "JSON" // optional
 });