3
我想对我的页面中嵌入的Flex应用程序使用Javascript回调。通过一些例子来看,我已经看到了用于获取到Flex应用程序的引用这段代码:什么版本的IE使用窗口[objectName]而不是window.document [objectName]?
// Get the reference:
function thisFlexApp(appName) {
if(navigator.appName.indexOf ('Microsoft') != -1) {
return window[appName];
}
else {
return window.document[appName];
}
}
// Use it:
var someVariable = thisFlexApp('NameOfFlexApp').callbackMethod();
我使用的方法,但使用IE9我得到指示“thisFlexApp”通话没有工作的错误。原来,window.document [appName]在IE9中工作,但窗口[appName]没有。既然我不希望我的政府客户使用IE9,我想知道这个方法实际上可以使用什么版本的IE?是否有另一个测试可以更好地使用,而不是上面的测试,它只是假设所有版本的IE以某种方式工作?提前致谢。
良好的通话。为什么我不能想到这些东西? :) – Ocelot20 2011-05-31 17:52:16