0

我想测试包含图像的 jsonp url 的 $img。最佳做法是什么?

我应该嵌入另一个 $AJAX 调用吗?

var ebRand = Math.random()+'';
ebRand = ebRand * 75;
var URL = 'http://ox-d.bbt.com/w/1.0/arj?o='+ebRand+'&auid=258624&c.env=rvw';
$.ajax({
    async:true,
    url: URL,
    dataType: 'jsonp',
    crossDomain: true,
    success: openX,
    errror: errorX,
    jsonpCallback: 'openX'
});
function openX(data) {
    alert('SUccess however load function error.')
    var ad = data['ads']['ad'][0]['html'];
    $img = $(ad).find('img').attr('src');
    //I WANT TO TEST THE $IMG which holds the jsonp url for an image.
    //What is the best practive should I embedded another $AJAX call?

    console.log(data);
}
function errorX(data){
    alert('Error')
    }
4

0 回答 0