- iframe調(diào)用父頁面的方法 推薦度:
- 相關(guān)推薦
iframe調(diào)用父頁面方法
無論你將來用什么語言做網(wǎng)頁,都要先學(xué)習(xí)HTML(超文本標識語言),一種很簡單的語言,也是網(wǎng)頁設(shè)計的基礎(chǔ),找本自己能看懂的教材,瀏覽為主,不用記住所有的概念,以下是小編整理的iframe調(diào)用父頁面方法,歡迎來閱讀!
window.parent.xxxxx();//xxxxx()代表父頁面方法
具體列子如下,其中包括easyUI的右鍵和單擊事件
parent.jsp
body部分代碼
<body class="easyui-layout">
<!-- 左側(cè)目錄 -->
<p
data-options="region:'west',split:true,title:'主題',iconCls:'icon-arrowIn'"
style="width: 270px; background: #efefef">
<!-- 目錄數(shù) -->
<ul id="tree" class="easyui-tree"></ul>
</p>
<input type="hidden" value="${param.type }" id="themeType"/>
<!-- 右側(cè)窗體 -->
<p
data-options="region:'center',title:'內(nèi)容顯示',iconCls:'icon-arrowOut'" style="overflow: hidden">
<iframe name="leftIframe" id="leftIframe" src="" frameborder="0" height="100%" width="100%"></iframe>
</p>
<!-- 右鍵菜單 -->
<p id=rightCliMean class="easyui-menu" style="width:120px;">
<p onclick="updateTheme();" data-options="iconCls:'icon-edit'" >修改</p>
<p onclick="removeObjectNode();" data-options="iconCls:'icon-tip'" >刪除</p>
</p>
<script type="text/javascript">
loadTree();
</script>
</body>
js部分:
?
function loadTree() {
$('#tree').tree( {
url : 'xxxxx.action,
animate : true,
lines : true,
onContextMenu : function(e, node) {
e.preventDefault();
$(this).tree('select', node.target);
/**
* 不可以對根節(jié)點(默認主題)進行操作
*/
var parent = $(this).tree('getParent',node.target);
if(parent){
if(node.text == '默認主題'){
$.messager.alert("提示信息","默認主題不能進行操作!","warning");
return false;
}
$('#rightCliMean').menu('show',{
left: e.pageX,
top: e.pageY
});
}
},
onClick:function(node) {//單機事件
var type = node.attributes.type;
if("Schema" == type){
var themeType = $("#themeType").val();
$('#leftIframe').attr('src', 'xxxx.action');
return;
}
}
});
}
child.jsp
/**
* 刷新左側(cè)主題
*/
$(function(){
window.parent.loadTree();
})
【iframe調(diào)用父頁面方法】相關(guān)文章:
iframe調(diào)用父頁面的方法07-28
iframe子父頁面調(diào)用實例10-14
php調(diào)用父類方法08-04
在子類中應(yīng)該如何調(diào)用父類的構(gòu)造方法07-11
java調(diào)用的方法09-04
java調(diào)用的幾個方法07-27