iframe調用父頁面方法
無論你將來用什麼語言做網頁,都要先學習HTML(超文本標識語言),一種很簡單的語言,也是網頁設計的'基礎,找本自己能看懂的教材,瀏覽為主,不用記住所有的概念,以下是小編整理的iframe調用父頁面方法,歡迎來閲讀!
x();//xxxxx()代表父頁面方法
具體列子如下,其中包括easyUI的右鍵和單擊事件
body部分代碼
<body class="easyui-layout">
<!-- 左側目錄 -->
<p
data-options="region:'west',split:true,title:'主題',iconCls:'icon-arrowIn'"
style="width: 270px; background: #efefef">
<!-- 目錄數 -->
<ul id="tree" class="easyui-tree"></ul>
</p>
<input type="hidden" value="${ }" id="themeType"/>
<!-- 右側窗體 -->
<p
data-options="region:'center',title:'內容顯示',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')( {
url : 'on,
animate : true,
lines : true,
onContextMenu : function(e, node) {
entDefault();
$(this)('select', et);
/**
* 不可以對根節點(默認主題)進行操作
*/
var parent = $(this)('getParent',et);
if(parent){
if( == '默認主題'){
$t("提示信息","默認主題不能進行操作!","warning");
return false;
}
$('#rightCliMean')('show',{
left: X,
top: Y
});
}
},
onClick:function(node) {//單機事件
var type = ;
if("Schema" == type){
var themeType = $("#themeType")();
$('#leftIframe')('src', 'on');
return;
}
}
});
}
/**
* 刷新左側主題
*/
$(function(){
Tree();
})