1
只是想知道如果這是可能的,jQuery的獲取 - 返回的數據與HTML
content:function(callback) {
$.get('url', { data to pass to url },
function(data) {
var text = callback(data);
return "<div>" + text + "</div>";
});
});
我講具體的線路5
return "<div>" + text + "</div>";
我試圖用一個提示這樣做,混合回調數據顯示,但它沒有被包裹到div中。
這是行不通的。回調函數返回'text'變量 – thomaux
@Anzeo我不這麼認爲,因爲它是一個異步請求,應該調用回調來生成工具提示的內容。 – undefined
嗯,我不能確定,因爲我不知道回調的內部結構,但是目前有代碼,我會認爲它會像我所描述的那樣工作。也許OP應該提供更多的細節。 – thomaux