侧边栏小工具和Javascript问题 [英] SideBar Gadget and Javascript issue
问题描述
在小工具开发中,您可以使用以下命令设置弹出文件的名称:
System.Gadget.Flyout.file = "somefile.html";
在小工具开发中,您可以使用以下内容显示对话框,例如用于测试;
window.prompt("some text","some more text");
知道为什么下面的方法行不通吗?
In Gadget Development, you set the name of a flyout file by using;
System.Gadget.Flyout.file = "somefile.html";
In Gadget Development, you can use the following to display a dialog e.g. for testing purposes;
window.prompt("some text","some more text");
Any idea why the follow will not work?
var something = System.Gadget.Flyout.file;
window.prompt(something,"some more text");
或
or
window.prompt(System.Gadget.Flyout.file,"some more text");
我看不到它失败的原因,因为.file
是一个字符串.注意:我也尝试使用.file.toString()
,但这也失败了.
正在开发的小工具不会引发任何错误,并且仅指示代码未按预期执行.
显然我错过了这个问题:doh:
[MSDN System.Gadget.Flyout对象规范; http://msdn.microsoft.com/en-us/library/ff486195 (v = VS.85).aspx [
I see no reason for it failing as .file
is a string. Note: I have also tried using .file.toString()
, but that also fails.
No errors are thrown by the Gadget being developed, and only indications are code doesn''t execute as expected.
It must be that obvious that i am missing the problem :doh:
[MSDN System.Gadget.Flyout object specs; http://msdn.microsoft.com/en-us/library/ff486195(v=VS.85).aspx[^]]
推荐答案
好像我发现了问题的可能原因:http://msdn.microsoft.com/en-us/library/ms723664(VS.85).aspx [^ ]
在该站点上有一点点说:
此属性暴露的错误:
Windows Vista和Windows 7:**注意**该属性实际上只是写的.如果您尝试获取其值,将会引发错误.
因此,尽管文档告诉我们该属性是可读写的,但在Vista和Weven中似乎存在一个错误,使得该属性只能写.
希望能解释您的问题.
最好的问候,
曼弗雷德(Manfred)
Looks like I found a possible cause of the problem: http://msdn.microsoft.com/en-us/library/ms723664(VS.85).aspx[^]
A little bit down on that site it says this:
Bugs exposed by this property:
Windows Vista and Windows 7: ** NOTE ** THIS PROPERTY IS ACTUALLY WRITE-ONLY. IF YOU ATTEMPT TO GET ITS VALUE, AN ERROR WILL BE THROWN.
So eventhough the documentation tells us the property is read/write there seems to be a bug under Vista and Weven that makes it write only.
I hope that explains your problem.
Best Regards,
Manfred
这篇关于侧边栏小工具和Javascript问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!