[英]window.external not working in IE6 (Win XP SP3) from C# App
I've been using window.external in my c# windows application successfully to call a public function in my C# form. 我一直在C#Windows应用程序中成功使用window.external来以C#形式调用公共函数。 I've correctly set the objectforscripting property, and this works wonderfully on my development machine which has Windows 7 and IE9.
我已经正确设置了objectforscripting属性,并且该属性在具有Windows 7和IE9的开发计算机上非常有效。
On my test machine however, which is a windows XP computer, window.external is not working. 但是,在我的测试计算机(是Windows XP计算机)上,window.external无法正常工作。 I am getting 'object' when I check the typeof of the window.external object, but when I try to enumerate it for functions, there's nothing.
当我检查window.external对象的类型时,我得到了“对象”,但是当我尝试对函数进行枚举时,什么也没有。
When I try to call the function nothing happens. 当我尝试调用该函数时,没有任何反应。 There must be a javascript error, but don't know what it is since the browser doesn't tell me.
一定有一个JavaScript错误,但由于浏览器没有告诉我,所以不知道是什么错误。
I am sure windows.external is pretty popular and people must have used it on all OSs including WinXp and IE6. 我确信windows.external非常流行,人们肯定已经在包括WinXp和IE6在内的所有操作系统上使用了它。 Any idea why this is happening to me?
知道为什么我会这样吗?
Okay, I am a bit embarrassed, but I thought I should tell everybody how I solved it instead of deleting the question so that if anyone else's been stupid enough, they'll know. 好的,我有点不好意思,但是我认为我应该告诉大家我是如何解决的,而不是删除问题,以便如果其他人足够愚蠢,他们就会知道。
The function I am referring to had a call to mshtml dll, which was not a part of my setup build sent to win xp. 我所指的功能有一个对mshtml dll的调用,这不是我的安装版本发送给Win XP的一部分。 window.external doesn't execute a function at all if there's an exception in it like this one.
如果其中存在异常,则window.external根本不会执行任何功能。
I could solve it by including mshtml in the setup. 我可以通过在设置中包含mshtml来解决它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.