-6
我正在做一個簡單的jquery ajax調用該URL,如下所示。響應是OK 200,我正在嘗試console.log responseText,但我什麼都沒有收到。我究竟做錯了什麼?jQuery Ajax響應200,但無法訪問響應數據
而我該如何在沒有jQuery的純JavaScript中做到這一點?
$.ajax({
url:'https://poloniex.com/private.php?currencyPair=BTC_LTC&rate=0.016&amount=1&command=buy',
dataType:'json',
success: function(data, textStatus, xhr){
console.log('asdfasdfadsf');
console.log(data);
console.log('hello' + textStatus);
console.log(xhr.responseText);
}//success
}); //ajax
那你記錄'data'然後試着訪問'xhr.responseText' – tymeJV
我怎麼看它:創建ajax.html +粘貼responseText那裏 - 9/10它會顯示一個錯誤 – ThisGuyHasTwoThumbs
你已經設置了'dataType :'json',但這很明顯是HTML。 –