- 相關(guān)推薦
iframe調(diào)用父頁面的方法
貴有恒何必三更眠五更起,最無益只怕一日曝十日寒。 以下是小編為大家搜索整理的iframe調(diào)用父頁面的方法,希望能給大家?guī)韼椭?更多精彩內(nèi)容請及時(shí)關(guān)注我們應(yīng)屆畢業(yè)生考試網(wǎng)!
1
window.parent.xxxxx();//xxxxx()代表父頁面方法 |
具體列子如下,其中包括easyUI的右鍵和單擊事件
parent.jsp
body部分代碼
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
<body class="easyui-layout"><!-- 左側(cè)目錄 --><divdata-options="region:'west',split:true,title:'主題',iconCls:'icon-arrowIn'"style="width: 270px; background: #efefef"><!-- 目錄數(shù) --><ul id="tree" class="easyui-tree"></ul></div><input type="hidden" value="${param.type }" id="themeType"/><!-- 右側(cè)窗體 --><divdata-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></div><!-- 右鍵菜單 --><div id=rightCliMean class="easyui-menu" style="width:120px;"><div onclick="updateTheme();" data-options="iconCls:'icon-edit'" >修改</div><div onclick="removeObjectNode();" data-options="iconCls:'icon-tip'" >刪除</div></div><script type="text/javascript">loadTree();</script></body> |
js部分:
?
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
function loadTree() {$('#tree').tree( {url : 'xxxxx.action,animate : true,lines : true,onContextMenu : function(e, node) {e.preventDefault();$(this).tree('select', node.target);/*** 不可以對根節(jié)點(diǎn)(默認(rèn)主題)進(jìn)行操作*/var parent = $(this).tree('getParent',node.target);if(parent){if(node.text == '默認(rèn)主題'){$.messager.alert("提示信息","默認(rèn)主題不能進(jìn)行操作!","warning");return false;}$('#rightCliMean').menu('show',{left: e.pageX,top: e.pageY});}},onClick:function(node) {//單機(jī)事件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)用父頁面方法01-24
iframe子父頁面調(diào)用實(shí)例05-18
php調(diào)用父類方法08-04
在子類中應(yīng)該如何調(diào)用父類的構(gòu)造方法07-11
java調(diào)用的方法04-20