html中引入調用另外一個公用html模板文件的方法

html中引入調用另外一個公用html模板文件的方法

https://www.w3h5.com/post/53.htmlhtml

這裏我使用jquery的方法jquery

<body>
    <div id="page1"></div>
    <div id="page2"></div>
    <script>
          $("#page1").load("page/Page_1.html");
          $("#page2").load("page/Page_2.html");
    </script>
</body>

 

 

 

iframe如何觸發父元素事件以及父頁面控制iframe子頁面元素

https://blog.csdn.net/weixin_38047955/article/details/78803291post

父元素訪問子元素spa

$('#iframeID').contents().find('#元素id')

子元素訪問父元素.net

$(window.parent.document).find(""#元素id");
// 或者:$("#元素id",window.parent.document);
相關文章
相關標籤/搜索