如何从网址获取JSON数据

时间:2019-06-27 11:14:49

标签: javascript json ajax

我想借助AJAX代码从该URL获取JSON形式的数据

http://track.dtdc.com/ctbs-tracking/customerInterface.tr?submitName=getLoadMovementDetails&cnNo=Z88555523

代码段:-

    var settings = {
              async: true,
              crossDomain: true,
              url: "http://track.dtdc.com/ctbs-tracking/customerInterface.tr?submitName=getLoadMovementDetails&cnNo=Z88555523",
              method: "GET",
              dataType : "json",
              headers: {
                "content-type": "application/x-www-form-urlencoded",
                "cache-control": "no-cache",
                "postman-token": "36eb6700-cbf9-688a-cc22-cac462f7aae3"
                     },
              data: {}
    }

            $.ajax(settings).done(function (response) {
              console.log(response);
            });

    console.log("Apna RESPONSE++++++++++++++:: "
            + console.log(response));   

When I hit this url in postman(google) , I got the response like this

This ERROR COMES

0 个答案:

没有答案