fetch jsonp请求接口

function loadTbbRec() {
    var fetchJsonp = require('fetch-jsonp');
    fetchJsonp(ext.info.tbbRecUrl, {
        headers: {
            'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
        },
        jsonpCallback: 'callback',
        credentials: 'include'
        
    }).then(function (res) {
        var obj = res.json();
        obj.then(function(data) {
            var str = '';
            var i;
            for (i in data) {

            }

            $('#carlist').append(str);
        });
        
    }).then(function (data) {
        console.log(data);
    });
}

 

posted on 2017-10-17 17:32  dongruiha  阅读(678)  评论(0编辑  收藏  举报

导航