<script>
var getJSON = function(url) {
return new Promise(function(resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open('get', url, true);
xhr.responseType = 'json';
xhr.onload = function() {
var status = xhr.status;
if (status == 200) {
resolve(xhr.response);
} else {
reject(status);
}
};
xhr.send();
});
};
var isRequest = false;
function requestListData(genDateStart,genDateEnd,contrNo) {
getJSON('http://192.168.3.54:8881/etradso-region/region/province/queryAllProvince').then(function(data) {
alert('Your Json result is: ' + data); //you can comment this, i used it to debug
}, function(status) { //error detection....
alert('Something went wrong.');
});
}
</script>