MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / get

Method get

src/common/overlay/levelRenderer/Http.js:24–49  ·  view source on GitHub ↗

* @function LevelRenderer.Tool.Http.prototype.get * @description get请求。 * @param {(string|IHTTPGetOption)} url - 请求url * @param {function} onsuccess - 请求成功函数 * @param {function} onerror - 请求失败函数 * @param {Object} opts - 额外参数 * @returns {number} cos值

(url, onsuccess, onerror)

Source from the content-addressed store, hash-verified

22 * @returns {number} cos值
23 */
24 get(url, onsuccess, onerror) {
25 if (typeof(url) === 'object') {
26 var obj = url;
27 url = obj.url;
28 onsuccess = obj.onsuccess;
29 onerror = obj.onerror;
30
31 }
32 var xhr = window.XMLHttpRequest
33 ? new XMLHttpRequest()
34 : new window.ActiveXObject('Microsoft.XMLHTTP');
35 xhr.open('GET', url, true);
36 xhr.onreadystatechange = function () {
37 if (xhr.readyState == 4) {
38 if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {
39 onsuccess && onsuccess(xhr.responseText);
40 } else {
41 onerror && onerror();
42 }
43 xhr.onreadystatechange = new Function();
44 xhr = null;
45 }
46 };
47
48 xhr.send(null);
49 }
50
51}

Callers 15

getVectorTileCRSExtentFunction · 0.45
getCRSMethod · 0.45
registerCRSMethod · 0.45
getSymbolFunction · 0.45
jquery.jsFile · 0.45
androidExecFunction · 0.45
pollOnceFunction · 0.45
cordova-2.7.0.jsFile · 0.45
addDataMethod · 0.45
setDataMethod · 0.45
removeDataMethod · 0.45
transferToMercatorMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected