IM()jQuery函數,包括內部的另一個HTML文件的HTML標籤。 代碼示例:jQuery的.load()使用.load功能不加載HTML註釋標記
a.html:
<html>
<head>
<script src="jquery.js"></script>
<script>
function loadContent()
{
$("#includedContent").load("b.html");
}
</script>
</head>
<body>
<div id="includedContent"></div>
<script>loadContent()</script>
</body>
b.html:
<!--Include it-->
<p> This is my include file </p>
,當我打開a.html在我的瀏覽器,然後單擊 「查看源文件」 我不能見
<!--Include it-->
這是爲什麼? 我需要它來追蹤東西。
如果你犯了一個簡單的HTML文件:
<html>
<body>
<!-- Hello -->
<p>Hello world </p>
</body>
</html>
打開它在瀏覽器中,單擊 「查看源文件」。你可以看到
<!-- Hello -->
爲什麼當我們使用.load()時我們看不到註釋???
你爲什麼依靠評論來追蹤? – ShankarSangoli 2012-01-29 16:25:22
我需要它爲adv人檢查是否操作下面的代碼... – lolo 2012-01-29 16:27:27