带有弹出窗口的小工具vista错误变量

时间:2010-02-09 00:20:25

标签: windows-desktop-gadgets

我对弹出按钮的变量有问题:

    var friendsUser = "";
    var friendsMdp = "";


    System.Gadget.Settings.write("variableName", variableName);
    System.Gadget.settingsUI = "Settings.html";
    System.Gadget.onSettingsClosed = SettingsClosed;
    System.Gadget.Flyout.visible = SettingsClosed;



    function SettingsClosed() {
        variableName = System.Gadget.Settings.read("variableName");
        friendsUser = System.Gadget.Settings.read("friendUser");
        friendsMdp = System.Gadget.Settings.read("friendMdp");
        setContentText();
    }

    function flyFriends()
    {
    System.Gadget.Flyout.file = 'friends.htm';
    System.Gadget.Flyout.show = true ;

    var flyoutDiv = System.Gadget.Flyout.document.parentWindow;
    flyoutDiv.gMyVar = friendsUser;
    flyoutDiv.gMyVar2 = friendsMdp; 
    }

如果我使用这个我的flyout var是未定义的,如果我写:var friendsUser =“test”; 我有变量测试和使用后设置我什么都没有... 如果我在System.Gadget.Flyout.show = true之前在flyoutDiv中写var;小工具bug。

我的设置没有问题,但刷新了var ...

你知道吗?

谢谢大家!

1 个答案:

答案 0 :(得分:0)

var variable = System.Gadget.Settings.read(“friendsUser”);

在弹出窗口中为我们设置var