iframe子页调用父页的函数,为什么无法调用
html代码如下
<div data-options="region:'center'" style="width:100%;height:100%;">
<div id="tt" class="easyui-tabs" data-options="tools:'#tab-tools'" style="width:100%;height:800px">
<div title="首页" style="padding:10px">
<a href="javascript:void(0)" onclick="addPanel('vvvvvv2')">添加2222tab</a>
</div>
<div title="新面" data-options="closable:false" style="padding:10px; width:990px;height:600px;overflow:hidden">
<iframe marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" src="qg_news.aspx" style="width: 100%; height: 800px;"></iframe>
</div>
</div>
<div id="tab-tools">
</div>
<script type="text/javascript">
var index = 0;
function addPanel(stitle) {//在子页面asptest.aspx想调用这个函数
ary = stitle.split("|");
var getindex = $('#tt').tabs('getTab', ary[0]);
if (getindex != null) {
$('#tt').tabs('select', ary[0]);
}
else {
index++;
$('#tt').tabs('add', {
title: ary[0],
content: '<div style="padding:10px;style="width:990px; height: 800px;"><iframe id="showiframe" name="showiframe" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" src="' asptest.aspx'" style="width:100%; height: 800px;"></iframe></div>',
closable: true
});
}
}
function removePanel() {
var tab = $('#tt').tabs('getSelected');
if (tab) {
var index = $('#tt').tabs('getTabIndex', tab);
$('#tt').tabs('close', index);
}
}
</script>
</body>
子页如下
<a href="javascript:void(0)" onclick="window.frames[0].kk('is ok?')">AAAAA</a>