当前位置: 首页 > 图文教程 > 网络编程 > Javascript > 解决extjs在firefox中关闭窗口再打开后iframe中js函数访问不到的问题

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 解决extjs在firefox中关闭窗口再打开后iframe中js函数访问不到的问题


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 278 ::
收藏到网摘: n/a

最近做ext时遇到一个问题,在firefox中浏览ext应用,加载后第一次打开一个嵌入iframe的Window时,可以直接通过js代码来执行 iframe中的js函数,但是如果将窗口关闭后重新再打开,将会抛出异常,说是funcName is not a function 在IE与google chrome中则一切正常,很是郁闷,找了很多种调用iframe中函数的方法,问题一直没有解决。今天在google上又搜索了一下,耐心的浏览搜索结果,最后发现有人写到可以用
document.getElementById('iframeid').contentWindow.myFunc();
这样的方式,以前没有看到过这种写法,抱着死马当活马医的心态,试了一下这段代码。奇迹发生了,药到病除。现在这种方法在前面提到的三种浏览器中都能正常的工作,在这里做下笔记,以备后用。