通過iframe引入另外一個專案中的html片段到專案中,解決樣式,高度,相容等問題的策略
<!--尾部開始-->
<iframe src="http://172.16.24.11:9000/cartoon-web/footer_new"
marginheight="0" marginwidth="0" frameborder="0" scrolling="no"
width='100%' height='392' id="iframepage" name="iframepage" onLoad="iFrameHeight()" ></iframe>
<!--尾部結束-->
<script language="javascript" type="text/javascript" charset="utf-8" src="js/jquery-2.1.1.js"></script>
<script language="javascript" type="text/javascript" charset="utf-8">
$(function(){
$(".wj_content form table tbody tr td.title").each(function(index,domEle){
$(this).text((index+1) + "、" +$(this).text());
});
});
function iFrameHeight() {
var ifm= document.getElementById("iframepage");
var subWeb = document.frames ? document.frames["iframepage"].document :ifm.contentDocument;
if(ifm != null && subWeb != null) {ifm.height = subWeb.body.scrollHeight;}
}
</script>