I'm developing a simple gadget for Windows 7 as a learning exercise.
I read in this article (under the subtopic Gadgets and Script) that to initialize the gadget, you should use document.onreadystatechange
instead of events such as onLOad
. I've seen it in the example project code I've looked through as well. This is what I came up with for my project.
document.onreadystatechange = function()
{
if(document.readyState == "complete")
{
System.Gadget.settingsUI = "settings.html"; //this line enables the settings UI
System.Gadget.onSettingsClosed = settingsClosed;
}
}
However when I use this snippet in my work, it doesn't work. The Options button in the gadget doesn't show up. If I use onLoad
, it works. I have installed 2 gadgets. Each of them use these 2 methods. One use onLoad
and the other use document.onreadystatechange
. And both of them works!
Now I'm confused why it doesn't work with my gadget. Is there any important part I'm overlooking?