Chrome版本: 42.0.2311.135 m
示例1:
$("#iframeId").attr("src", url).on("load", function(event){
console.info($(this).context.contentWindow.document.body);
};示例2:
console.info($("#iframeId")[0].contentWindow.document.body);
本文介绍如何使用JavaScript更新iframe中的源地址,并演示了两种获取iframe内部document.body的方法。
Chrome版本: 42.0.2311.135 m
示例1:
$("#iframeId").attr("src", url).on("load", function(event){
console.info($(this).context.contentWindow.document.body);
};console.info($("#iframeId")[0].contentWindow.document.body);
11万+

被折叠的 条评论
为什么被折叠?