【发布时间】:2011-12-15 08:52:18
【问题描述】:
我需要获取带有<div> 标签和所有内容的原始html,并将其放入变量字符串中。
所以如果我有一个单独的文件 test.html
<div>
<div><img src="images/htc_hero_wallpaper_01.jpg" width="20%" height="20%" alt="" /></div>
WORKS!!!
</div>
我需要 jQuery 命令
$.ajax({
url: "test.html",
success: function(){
var htmlraw = ?????
alert(htmlraw) /// should print the raw test.html
}
});
打印
<div>
<div><img src="images/htc_hero_wallpaper_01.jpg" width="20%" height="20%" alt="" /></div>
WORKS!!!
</div>
【问题讨论】: