|
@ -140,21 +140,13 @@ function getCSV(url, ptr) { |
|
|
if(xhr != null) { |
|
|
if(xhr != null) { |
|
|
xhr.open("GET", url, true); |
|
|
xhr.open("GET", url, true); |
|
|
xhr.onreadystatechange = q; |
|
|
xhr.onreadystatechange = q; |
|
|
try { |
|
|
|
|
|
xhr.send(); |
|
|
xhr.send(); |
|
|
} catch (error) { |
|
|
|
|
|
console.log(error.message); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
function q() { |
|
|
function q() { |
|
|
if(xhr.readyState == 4) { |
|
|
if(xhr.readyState == 4) { |
|
|
if(null != xhr.responseText) { |
|
|
if(null != xhr.responseText) { |
|
|
if(null != ptr) { |
|
|
if(null != ptr) { |
|
|
try { |
|
|
|
|
|
ptr(xhr.responseText); |
|
|
ptr(xhr.responseText); |
|
|
} catch (error) { |
|
|
|
|
|
console.log(error.message); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -168,22 +160,13 @@ function getAjax(url, ptr, method="GET", json=null) { |
|
|
xhr.onreadystatechange = p; |
|
|
xhr.onreadystatechange = p; |
|
|
if("POST" == method) |
|
|
if("POST" == method) |
|
|
xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); |
|
|
xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); |
|
|
try { |
|
|
|
|
|
xhr.send(json); |
|
|
xhr.send(json); |
|
|
} catch (error) { |
|
|
|
|
|
console.log(error.message); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
function p() { |
|
|
function p() { |
|
|
if(xhr.readyState == 4) { |
|
|
if(xhr.readyState == 4) { |
|
|
if(null != xhr.responseText) { |
|
|
if(null != xhr.responseText) { |
|
|
if(null != ptr) { |
|
|
if(null != ptr) |
|
|
try { |
|
|
|
|
|
ptr(JSON.parse(xhr.responseText)); |
|
|
ptr(JSON.parse(xhr.responseText)); |
|
|
} catch (error) { |
|
|
|
|
|
console.log(error.message); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|