下面的代碼是我實現中的ajax調用的響應。 /* response of ajax call */ <script> var count = 6; </script> <div> some code goes here</div>
如何從ajax響應獲取特定值
如何從jQuery的Ajax響應
$.ajax({
url: url,
type: "GET",
dataType: "text",
timeout: 20000,
success: function(response){ },
error: function(){/* error code goes here*/}
});
謝謝J.M的回覆。響應以html的形式出現,它包含具有計數值的腳本標記,需要訪問該計數值,並且ajax dataType是文本。 – shi69
你不能改變響應類型嗎? – Jublo