- iframe调用父页面的方法 推荐度:
- 相关推荐
iframe调用父页面方法
无论你将来用什么语言做网页,都要先学习HTML(超文本标识语言),一种很简单的语言,也是网页设计的基础,找本自己能看懂的教材,浏览为主,不用记住所有的概念,以下是小编整理的iframe调用父页面方法,欢迎来阅读!
window.parent.xxxxx();//xxxxx()代表父页面方法
具体列子如下,其中包括easyUI的右键和单击事件
parent.jsp
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="${param.type }" 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').tree( {
url : 'xxxxx.action,
animate : true,
lines : true,
onContextMenu : function(e, node) {
e.preventDefault();
$(this).tree('select', node.target);
/**
* 不可以对根节点(默认主题)进行操作
*/
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
/**
* 刷新左侧主题
*/
$(function(){
window.parent.loadTree();
})
【iframe调用父页面方法】相关文章:
iframe调用父页面的方法07-28
iframe子父页面调用实例10-14
php调用父类方法08-04
Python中子类怎样调用父类方法09-04
在子类中应该如何调用父类的构造方法07-11
java调用的方法09-04
java调用的几个方法07-27
java调用bat文件的方法08-09
java远程方法调用技巧09-21
Java远程方法调用RMI08-24