diff options
author | Azul <azul@riseup.net> | 2012-08-21 18:07:36 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2012-08-21 18:07:36 +0200 |
commit | d6a78049f3356d9d645143362eca74434410bf62 (patch) | |
tree | d245ba256bf48267ed2f1b5c5f4c8739d6c98b5a /src/jqueryRest.js | |
parent | 0461d76899379cb1e2ecd15456d2e6eb4fb8fa60 (diff) |
first round of making jslint happy
Diffstat (limited to 'src/jqueryRest.js')
-rw-r--r-- | src/jqueryRest.js | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/jqueryRest.js b/src/jqueryRest.js index 8c8163c..9e7f72b 100644 --- a/src/jqueryRest.js +++ b/src/jqueryRest.js @@ -7,7 +7,7 @@ jqueryRest = function() { function paths(path) { - return path + return path; } // Perform ajax requests at the specified path, with the specified parameters @@ -15,12 +15,13 @@ jqueryRest = function() { function ajaxRequest(relative_path, params, callback) { var full_url = this.geturl() + this.paths(relative_path); - if( window.XMLHttpRequest) + if( window.XMLHttpRequest) { xhr = new XMLHttpRequest(); + } else if (window.ActiveXObject){ - try{ + try { xhr = new ActiveXObject("Microsoft.XMLHTTP"); - }catch (e){} + } catch (e){} } else { @@ -42,7 +43,7 @@ jqueryRest = function() { { session.error_message("Ajax failed."); } - }; + } function parseResponse() { if (responseIsXML()) { @@ -50,16 +51,16 @@ jqueryRest = function() { } else if (responseIsJSON()) { return JSON.parse(xhr.responseText); } - }; + } function responseIsXML() { return (xhr.responseType == 'document') || - (xhr.getResponseHeader("Content-Type").indexOf('application/xml') >= 0) + (xhr.getResponseHeader("Content-Type").indexOf('application/xml') >= 0); } function responseIsJSON() { return (xhr.responseType == 'json') || - (xhr.getResponseHeader("Content-Type").indexOf('application/json') >= 0) + (xhr.getResponseHeader("Content-Type").indexOf('application/json') >= 0); } function parseXML(xml) { @@ -68,7 +69,7 @@ jqueryRest = function() { } else { return parseNodes(xml.childNodes); } - }; + } function parseAttributesOfElement(elem) { var response = {}; @@ -79,7 +80,7 @@ jqueryRest = function() { } } return response; - }; + } function parseNodes(nodes) { var response = {}; @@ -88,7 +89,7 @@ jqueryRest = function() { response[node.tagName] = node.textContent || true; } return response; - }; + } // we do not fetch the salt from the server function register(session, callback) @@ -123,5 +124,5 @@ jqueryRest = function() { handshake: handshake, authenticate: authenticate, upgrade: upgrade - } -} + }; +}; |