下面这是问题的描述。。login.jsp index.jsp video.jsp 其中 video页面 放了一个组件 具体代码是
<div id="sidebar02">
<div id="video">
<object classid="clsid:347567CC-6E12-4D94-B340-28F34981B6C7"
width="640" height="480" id="dthtId" name="Alarm">
</object>
</div>
</div>
index.jsp 页面引用了 video.jsp页面 。代码如下region: 'center',
xtype: 'tabpanel',
width:820,
autoScroll: true,
activeTab: 0,
items: [{
id:'spll',
title: '视频浏览',
autoScroll: true,
html : '<iframe id="spll" src="afpt ideo.jsp" name = "spll" width="100%" height="100%" scrolling="yes"></iframe>'我现在需要的是。。当登陆的时候 获取到video 页面组件的控件方法。。有什么办法么。
<div id="sidebar02">
<div id="video">
<object classid="clsid:347567CC-6E12-4D94-B340-28F34981B6C7"
width="640" height="480" id="dthtId" name="Alarm">
</object>
</div>
</div>
index.jsp 页面引用了 video.jsp页面 。代码如下region: 'center',
xtype: 'tabpanel',
width:820,
autoScroll: true,
activeTab: 0,
items: [{
id:'spll',
title: '视频浏览',
autoScroll: true,
html : '<iframe id="spll" src="afpt ideo.jsp" name = "spll" width="100%" height="100%" scrolling="yes"></iframe>'我现在需要的是。。当登陆的时候 获取到video 页面组件的控件方法。。有什么办法么。
在index.jsp上面写document.getElementById('video.jsp iframe的id').document.getElementById('dthtId')
就是index.jsp里面的iframe啊你index.jsp不是iframe进来的video.jsp吗就那个iframe标签上的id
document.getElementById('video.jsp?param=spll').document.getElementById('dthtId')
你看你index.jsp页面里是不是有这个标签然后给你这个标签上加个id,这块id写什么
document.getElementById('video.jsp?param=spll').document.getElementById('dthtId')
这句js第一个那块就写什么~·就是红色的地方
title: '视频浏览',
autoScroll: true,
html : '<iframe id="spll" src="afpt/video.jsp" name = "spll" width="100%" height="100%" scrolling="yes"></iframe>'这个是用到iframe 的地方 也有ID。。
嗯 就是这个splldocument.getElementById('spll').document.getElementById('dthtId')
这么写
title: '视频浏览',
autoScroll: true,
html : '<iframe id="spll" src="afpt/video.jsp" name = "spll" width="100%" height="100%" scrolling="yes"></iframe>'
你这个js什么时候加载到页面上?
var menuHtml = document.getElementById("sidebar01").innerHTML;
new Ext.Viewport({
layout:'border',
width:1024,
items: [
new Ext.BoxComponent({
region:'north',
el: 'header',
height:69
}), {
region: 'west',
collapsible: true,
xtype: 'panel',
split:true,
title: date,
width:191,
html:menuHtml
}, {
region: 'center',
xtype: 'tabpanel',
width:820,
autoScroll: true,
activeTab: 0,
items: [{
id:'spll',
title: '视频浏览',
autoScroll: true,
html : '<iframe id="spll" src="afpt/video.jsp" name = "spll" width="100%" height="100%" scrolling="yes"></iframe>'
},{
id:'ywgz',
title: '业务规则设定',
autoScroll: true,
html : '<iframe id="ywgz" src="afpt/rule.jsp" name = "ywgz" width="100%" height="100%" scrolling="yes"></iframe>'
},{
id:'lxrgl',
title: '联系人管理',
autoScroll: true,
html : '<iframe id="lxrgl" src="sys/contactPeopleAction?resource=af010402" name = "lxrgl" width="100%" height="100%" scrolling="yes"></iframe>'
},{
id:'xtpz',
title: '用户管理',
autoScroll: true,
html : '<iframe id="lxrgl" src="sys/employeeAction?resource=af010401" name = "xtpz" width="100%" height="100%" scrolling="yes"></iframe>'
},{
id:'zysjpz',
title: '资源数据配置',
autoScroll: true,
html : '<iframe id="lxrgl" src="sys/ConfigAction!queryResource.action?resource=zy010305" name = "zysjpz" width="100%" height="100%" scrolling="yes"></iframe>'
}]
}]
});
})
我也试过了。当index 加载的时候 video 的onload 事件 不执行
必须在iframeID加载完之后执行
document.getElmentById("iframeID").onload=function(){
//.....获取对象
}