我正在尝试在iframe中插入jQuery和另一个JS文件。我想知道是否可能,或者是否存在某些问题?
假设这些页面只是在同一个域名下运行。
父页面将尝试使用Javascript覆盖iframe内的元素。 然后我需要在子页面(http://jsbin.com/esifez/2)上添加另一个jQuery库。
对此有什么想法吗?
假设这些页面只是在同一个域名下运行。
父页面将尝试使用Javascript覆盖iframe内的元素。 然后我需要在子页面(http://jsbin.com/esifez/2)上添加另一个jQuery库。
对此有什么想法吗?
$(function() {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'http://code.jquery.com/jquery-latest.min.js';
$("#main_iframe").contents().find("body").append(script);
});
演示链接。
谢谢。