问题描述
- extjs4怎么刷新<iframe>
-
var tab = Ext.create('Ext.TabPanel' { id:'myTabPanel' region:'center' layout: 'fit' itemId: 'center-tabs' items : [{ id:'home' title : ""Home Page"" iconCls: 'House' html : '<iframe src= ""jsp/homepage.jsp"" width=""100%"" height=""100%"" marginwidth=""0"" framespacing=""0"" marginheight=""0"" frameborder=""0"" ></iframe>' /*loader: { url:'jsp/homepage.jsp' loadMask: 'loading...' autoLoad: true scripts: true }*/ listeners:{ activate:function(tab){ } } }] });
试了好多方法都没用
this.loader.load();
tab.getUpdater().refresh();
this.getActiveTab().refresh();
解决方案
给iframe增加id,用js更新就好
html : '<iframe src= ""jsp/homepage.jsp"" id=""myifr"" width=""100%"" height=""100%"" marginwidth=""0"" framespacing=""0"" marginheight=""0"" frameborder=""0"" ></iframe>'
document.getElementById('myifr').contentWindow.location.reload()
解决方案二:
top.document.getElementById('myifr').contentWindow.location.reload()
时间: 2024-10-25 20:42:12