我想知道爲什麼我可以使用.load
到的信息非常具體的位裝載到一個頁面,但後來當我嘗試讀回我剛回到null
jQuery的.load工作,但不可讀
這個載入信息是我使用加載的信息
$(function(){
$('#code').load('stuff.html #specificstuff');
});
該位jQuery和這是我使用重複什麼代碼#code
var content = document.getElementById('#code');
document.write(content);
但這個程序運行時,我剛剛回到null
您正試圖在不同的域上加載的頁面? –
@MarioJVargas nope同域,並且.load函數確實有效,但不會被讀回 – user3743076
'#code'是什麼類型的元素?而stuff.html頁面是否包含ID爲'specificstuff'的元素? –