<script>
window.parent.$(function () {
var head = document.getElementsByTagName("head").item(0);
//获取父窗口link标签对象列表
var linkList = window.parent.document.getElementsByTagName("link");
for (var i = 0; i < linkList.length; i++) {
var _link = document.createElement("link");
_link.rel = 'stylesheet'
_link.type = 'text/css';
_link.href = linkList[i].href;
head.appendChild(_link);
}
//获取父窗口script标签对象列表
var scriptList = window.parent.document.getElementsByTagName("script");
for (var i = 0; i < scriptList.length; i++) {
var _script = document.createElement("script");
_script.type = 'text/javascript';
_script.src = scriptList[i].src;
head.appendChild(_script);
}
});
</script>
网友评论