text: Ext.data.JsonP.mindsmine_Ajax({"tagname":"class","name":"mindsmine.Ajax","autodetected":{},"files":[{"filename":"mindsmine.js","href":null}],"singleton":true,"since":"1.0","members":[{"name":"__ALLOWED_METHODS","tagname":"property","owner":"mindsmine.Ajax","id":"property-__ALLOWED_METHODS","meta":{"private":true,"readonly":true}},{"name":"__DEFAULT_ASYNC","tagname":"property","owner":"mindsmine.Ajax","id":"property-__DEFAULT_ASYNC","meta":{"private":true,"readonly":true}},{"name":"__DEFAULT_SCOPE","tagname":"property","owner":"mindsmine.Ajax","id":"property-__DEFAULT_SCOPE","meta":{"private":true,"readonly":true}},{"name":"__DEFAULT_TIMEOUT","tagname":"property","owner":"mindsmine.Ajax","id":"property-__DEFAULT_TIMEOUT","meta":{"private":true,"readonly":true}},{"name":"__DEFAULT_WITH_CREDENTIALS","tagname":"property","owner":"mindsmine.Ajax","id":"property-__DEFAULT_WITH_CREDENTIALS","meta":{"private":true,"readonly":true}},{"name":"_getXHRObject","tagname":"method","owner":"mindsmine.Ajax","id":"method-_getXHRObject","meta":{"private":true}},{"name":"_isRequestSuccessful","tagname":"method","owner":"mindsmine.Ajax","id":"method-_isRequestSuccessful","meta":{"private":true}},{"name":"_onRequestComplete","tagname":"method","owner":"mindsmine.Ajax","id":"method-_onRequestComplete","meta":{"private":true}},{"name":"request","tagname":"method","owner":"mindsmine.Ajax","id":"method-request","meta":{}}],"alternateClassNames":[],"aliases":{},"id":"class-mindsmine.Ajax","short_doc":"The Ajax class encapsulates an HTTP connection to the page's originating domain, allowing requests to be made to a\nUR...","component":false,"superclasses":[],"subclasses":[],"mixedInto":[],"mixins":[],"parentMixins":[],"requires":[],"uses":[],"html":"<div><div class='doc-contents'><p>The Ajax class encapsulates an HTTP connection to the page's originating domain, allowing requests to be made to a\nURL specified at request time.</p>\n        <p>Available since: <b>1.0</b></p>\n</div><div class='members'><div class='members-section'><div class='definedBy'>Defined By</div><h3 class='members-title icon-property'>Properties</h3><div class='subsection'><div id='property-__ALLOWED_METHODS' class='member first-child not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='mindsmine.Ajax'>mindsmine.Ajax</span><br/></div><a href='#!/api/mindsmine.Ajax-property-__ALLOWED_METHODS' class='name expandable'>__ALLOWED_METHODS</a> : <a href=\"#!/api/String\" rel=\"String\" class=\"docClass\">String</a>[]<span class=\"signature\"><span class='private' >private</span><span class='readonly' >readonly</span></span></div><div class='description'><div class='short'>Provides an array of allowed HTTP methods. ...</div><div class='long'><p>Provides an array of allowed HTTP methods.</p>\n<p>Defaults to: <code>[&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;, &quot;PATCH&quot;, &quot;DELETE&quot;]</code></p>        <p>Available since: <b>1.0</b></p>\n</div></div></div><div id='property-__DEFAULT_ASYNC' class='member  not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='mindsmine.Ajax'>mindsmine.Ajax</span><br/></div><a href='#!/api/mindsmine.Ajax-property-__DEFAULT_ASYNC' class='name expandable'>__DEFAULT_ASYNC</a> : <a href=\"#!/api/Boolean\" rel=\"Boolean\" class=\"docClass\">Boolean</a><span class=\"signature\"><span class='private' >private</span><span class='readonly' >readonly</span></span></div><div class='description'><div class='short'>Provides the default async value for the Ajax calls. ...</div><div class='long'><p>Provides the default <code>async</code> value for the Ajax calls.</p>\n<p>Defaults to: <code>true</code></p>        <p>Available since: <b>1.0</b></p>\n</div></div></div><div id='property-__DEFAULT_SCOPE' class='member  not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='mindsmine.Ajax'>mindsmine.Ajax</span><br/></div><a href='#!/api/mindsmine.Ajax-property-__DEFAULT_SCOPE' class='name expandable'>__DEFAULT_SCOPE</a> : <a href=\"#!/api/Object\" rel=\"Object\" class=\"docClass\">Object</a><span class=\"signature\"><span class='private' >private</span><span class='readonly' >readonly</span></span></div><div class='description'><div class='short'>Provides the default scope value for callbacks. ...</div><div class='long'><p>Provides the default <code>scope</code> value for callbacks.</p>\n<p>Defaults to: <code>window</code></p>        <p>Available since: <b>1.0</b></p>\n</div></div></div><div id='property-__DEFAULT_TIMEOUT' class='member  not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='mindsmine.Ajax'>mindsmine.Ajax</span><br/></div><a href='#!/api/mindsmine.Ajax-property-__DEFAULT_TIMEOUT' class='name expandable'>__DEFAULT_TIMEOUT</a> : <a href=\"#!/api/Number\" rel=\"Number\" class=\"docClass\">Number</a><span class=\"signature\"><span class='private' >private</span><span class='readonly' >readonly</span></span></div><div class='description'><div class='short'>Provides the default timeout (in milliseconds) for the Ajax calls. ...</div><div class='long'><p>Provides the default <code>timeout</code> (in milliseconds) for the Ajax calls.</p>\n<p>Defaults to: <code>120000</code></p>        <p>Available since: <b>1.0</b></p>\n</div></div></div><div id='property-__DEFAULT_WITH_CREDENTIALS' class='member  not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='mindsmine.Ajax'>mindsmine.Ajax</span><br/></div><a href='#!/api/mindsmine.Ajax-property-__DEFAULT_WITH_CREDENTIALS' class='name expandable'>__DEFAULT_WITH_CREDENTIALS</a> : <a href=\"#!/api/Boolean\" rel=\"Boolean\" class=\"docClass\">Boolean</a><span class=\"signature\"><span class='private' >private</span><span class='readonly' >readonly</span></span></div><div class='description'><div class='short'>Provides the default withCredentials value for Ajax calls. ...</div><div class='long'><p>Provides the default <code>withCredentials</code> value for Ajax calls.</p>\n<p>Defaults to: <code>false</code></p>        <p>Available since: <b>1.0</b></p>\n</div></div></div></div></div><div class='members-section'><div class='definedBy'>Defined By</div><h3 class='members-title icon-method'>Methods</h3><div class='subsection'><div id='method-_getXHRObject' class='member first-child not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='mindsmine.Ajax'>mindsmine.Ajax</span><br/></div><a href='#!/api/mindsmine.Ajax-method-_getXHRObject' class='name expandable'>_getXHRObject</a>( <span class='pre'></span> ) : XMLHttpRequest<span class=\"signature\"><span class='private' >private</span></span></div><div class='description'><div class='short'>Returns the Ajax object based upon the browser. ...</div><div class='long'><p>Returns the Ajax object based upon the browser.</p>\n        <p>Available since: <b>1.0</b></p>\n<h3 class='pa'>Returns</h3><ul><li><span class='pre'>XMLHttpRequest</span><div class='sub-desc'>\n</div></li></ul><h3 class='pa'>Throws</h3><ul><li><span class='pre'>Error</span><div class='sub-desc'>\n</div></li></ul></div></div></div><div id='method-_isRequestSuccessful' class='member  not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='mindsmine.Ajax'>mindsmine.Ajax</span><br/></div><a href='#!/api/mindsmine.Ajax-method-_isRequestSuccessful' class='name expandable'>_isRequestSuccessful</a>( <span class='pre'>status</span> ) : <a href=\"#!/api/Boolean\" rel=\"Boolean\" class=\"docClass\">Boolean</a><span class=\"signature\"><span class='private' >private</span></span></div><div class='description'><div class='short'>Checks the status of the response to the request. ...</div><div class='long'><p>Checks the status of the response to the request.</p>\n\n<p>The HTTP result codes <code>200</code> to <code>299</code> and <code>304</code> are\ndeemed as successful request.</p>\n\n<p>Handles an IE issue as well - <a href=\"https://prototype.lighthouseapp.com/projects/8886/tickets/129-ie-mangles-http-response-status-code-204-to-1223\">IE mangles status code 204</a></p>\n        <p>Available since: <b>1.0</b></p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>status</span> : <a href=\"#!/api/Number\" rel=\"Number\" class=\"docClass\">Number</a><div class='sub-desc'><p>The status code.</p>\n</div></li></ul><h3 class='pa'>Returns</h3><ul><li><span class='pre'><a href=\"#!/api/Boolean\" rel=\"Boolean\" class=\"docClass\">Boolean</a></span><div class='sub-desc'><p>Whether success/failure.</p>\n</div></li></ul></div></div></div><div id='method-_onRequestComplete' class='member  not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='mindsmine.Ajax'>mindsmine.Ajax</span><br/></div><a href='#!/api/mindsmine.Ajax-method-_onRequestComplete' class='name expandable'>_onRequestComplete</a>( <span class='pre'>request, scope, successFunc, failureFunc, [onCompleteFunc]</span> )<span class=\"signature\"><span class='private' >private</span></span></div><div class='description'><div class='short'>Called when the request has come back from the server. ...</div><div class='long'><p>Called when the request has come back from the server.</p>\n        <p>Available since: <b>1.0</b></p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>request</span> : XMLHttpRequest<div class='sub-desc'>\n</div></li><li><span class='pre'>scope</span> : <a href=\"#!/api/Object\" rel=\"Object\" class=\"docClass\">Object</a><div class='sub-desc'><p>The scope for the callback functions.</p>\n</div></li><li><span class='pre'>successFunc</span> : <a href=\"#!/api/Function\" rel=\"Function\" class=\"docClass\">Function</a><div class='sub-desc'><p>The function to be called upon success of the request.</p>\n</div></li><li><span class='pre'>failureFunc</span> : <a href=\"#!/api/Function\" rel=\"Function\" class=\"docClass\">Function</a><div class='sub-desc'><p>The function to be called upon failure of the request.</p>\n</div></li><li><span class='pre'>onCompleteFunc</span> : <a href=\"#!/api/Function\" rel=\"Function\" class=\"docClass\">Function</a> (optional)<div class='sub-desc'><p>The function to be called upon completion of the request.</p>\n</div></li></ul></div></div></div><div id='method-request' class='member  not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='mindsmine.Ajax'>mindsmine.Ajax</span><br/></div><a href='#!/api/mindsmine.Ajax-method-request' class='name expandable'>request</a>( <span class='pre'>method, url, options</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>Sends an HTTP request to a remote server. ...</div><div class='long'><p>Sends an HTTP request to a remote server.</p>\n\n<p>Requests made by this method are by default asynchronous, and will return immediately. No data from the\nserver will be available to the statement immediately following the <a href=\"#!/api/mindsmine.Ajax-method-request\" rel=\"mindsmine.Ajax-method-request\" class=\"docClass\">request</a> call. To process\nreturned data, use a success (or afterRequest) callback in the request options object.</p>\n\n<p>Example Usage:</p>\n\n<pre><code> <a href=\"#!/api/mindsmine.Ajax-method-request\" rel=\"mindsmine.Ajax-method-request\" class=\"docClass\">mindsmine.Ajax.request</a>(\n      \"GET\",\n      \"valid URL\",\n      {\n           headers: {\n                \"Accept\" : \"some value\",\n                \"Content-Type\" : \"some value\",\n                \"Authorization\" : \"some value\"\n           },\n\n           success: function (request) {\n                var responseJSON = JSON.parse(request.responseText);\n                console.log(responseJSON);\n           },\n\n           failure: function (request) {\n                console.log(\"HTTP error \" + request.status);\n           }\n      }\n );\n</code></pre>\n        <p>Available since: <b>1.0</b></p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>method</span> : <a href=\"#!/api/String\" rel=\"String\" class=\"docClass\">String</a><div class='sub-desc'><p>The HTTP method to use for the request. Note that the method name is case-sensitive\nand should be all caps.</p>\n</div></li><li><span class='pre'>url</span> : <a href=\"#!/api/String\" rel=\"String\" class=\"docClass\">String</a><div class='sub-desc'><p>The URL to which to send the request.</p>\n</div></li><li><span class='pre'>options</span> : <a href=\"#!/api/Object\" rel=\"Object\" class=\"docClass\">Object</a><div class='sub-desc'><p>An object which may contain the following properties:</p>\n<ul><li><span class='pre'>async</span> : <a href=\"#!/api/Boolean\" rel=\"Boolean\" class=\"docClass\">Boolean</a> (optional)<div class='sub-desc'><p><code>true</code> if this request should run asynchronously.\n<code>false</code> if this request should run synchronously (it will cause the UI to be blocked, the user\nwon't be able to interact with the browser until the request completes).</p>\n<p>Defaults to: <code>true</code></p></div></li><li><span class='pre'>headers</span> : <a href=\"#!/api/Object\" rel=\"Object\" class=\"docClass\">Object</a> (optional)<div class='sub-desc'><p>Request headers to set for the request.</p>\n</div></li><li><span class='pre'>scope</span> : <a href=\"#!/api/Object\" rel=\"Object\" class=\"docClass\">Object</a> (optional)<div class='sub-desc'><p>The scope in which to execute the callbacks (refers to the \"this\"\nparameter for the callback functions).</p>\n<p>Defaults to: <code>window</code></p></div></li><li><span class='pre'>jsonData</span> : <a href=\"#!/api/Object\" rel=\"Object\" class=\"docClass\">Object</a>/<a href=\"#!/api/String\" rel=\"String\" class=\"docClass\">String</a> (optional)<div class='sub-desc'><p>JSON data to use as the post.</p>\n</div></li><li><span class='pre'>withCredentials</span> : <a href=\"#!/api/Boolean\" rel=\"Boolean\" class=\"docClass\">Boolean</a> (optional)<div class='sub-desc'><p><code>true</code> to add the <code>withCredentials</code>\nproperty to the XHR object.</p>\n<p>Defaults to: <code>false</code></p></div></li><li><span class='pre'>beforeRequest</span> : <a href=\"#!/api/Function\" rel=\"Function\" class=\"docClass\">Function</a> (optional)<div class='sub-desc'><p>The function to be called before a network request is made to\nretrieve a data object.</p>\n</div></li><li><span class='pre'>afterRequest</span> : <a href=\"#!/api/Function\" rel=\"Function\" class=\"docClass\">Function</a> (optional)<div class='sub-desc'><p>The function to be called upon receipt of the HTTP response. This\nfunction is called regardless of success or failure. The callback is passed the following parameters:</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>response</span> : XMLHttpRequest<div class='sub-desc'><p>The XMLHttpRequest object containing the response data.\nSee <a href=\"http://www.w3.org/TR/XMLHttpRequest/\">www.w3.org/TR/XMLHttpRequest</a> for details about accessing elements of the response.</p>\n</div></li></ul></div></li><li><span class='pre'>success</span> : <a href=\"#!/api/Function\" rel=\"Function\" class=\"docClass\">Function</a><div class='sub-desc'><p>The function to be called upon success of the request. The callback is\npassed the following parameters:</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>response</span> : XMLHttpRequest<div class='sub-desc'><p>The XMLHttpRequest object containing the response data. See\n<a href=\"http://www.w3.org/TR/XMLHttpRequest/\">www.w3.org/TR/XMLHttpRequest</a> for details about accessing elements of the response.</p>\n</div></li></ul></div></li><li><span class='pre'>failure</span> : <a href=\"#!/api/Function\" rel=\"Function\" class=\"docClass\">Function</a><div class='sub-desc'><p>The function to be called upon failure of the request. The callback is\npassed the following parameters:</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>response</span> : XMLHttpRequest<div class='sub-desc'><p>The XMLHttpRequest object containing the response data. See\n<a href=\"http://www.w3.org/TR/XMLHttpRequest/\">www.w3.org/TR/XMLHttpRequest</a> for details about accessing elements of the response.</p>\n</div></li></ul></div></li></ul></div></li></ul><h3 class='pa'>Throws</h3><ul><li><span class='pre'>TypeError</span><div class='sub-desc'><p>If invalid arguments.</p>\n</div></li></ul></div></div></div></div></div></div></div>","meta":{}});