我想使用 Jquery 或 javascript 来获取 iframe 的原始内容(意味着每个字符)。这听起来很简单,但我仍在努力寻找正确的方法。
不过,目前它只是 iframe 中的 XML 内容。这里的代码:
$(function() {
var xmlContent = $("#CFrame").contents().find("*").text();
// The magic
$('#SResult').xslt({xml: xmlContent, xslUrl: 'stylesheet/designSS.xsl'});
});
html页面
<form id="searchForm" method="GET" target="ContentFrame" action="http://125.235.8.210:380/search" onSubmit="processContent()">
.....
</form>
</div>
<div id="SResult">
</div>
<iframe id="CFrame" name="ContentFrame" frameborder="1" height="2000px" width="1000px" scrolling="no" src="stylesheet/test.xml"></iframe>
</body>
谢谢,