none
在windows8应用开发中如何将营私策略加入到设置超级按钮中 RRS feed

  • 问题

  • 我想将隐私策略加入到设置中去代码如下:

    WinJS.Application.onsettings = function (e) {
                    e
    .detail.applicationcommands = { "隐私条款": { title: "隐私策略", href: “baidu 的网址" };
                   
    WinJS.UI.SettingsFlyout.populateSettings(e);
               
    };
            
               
    WinJS.Application.start();

    }

    运行后点“隐私策略”总是抛异常,提示不能访问外部资源。请问如果我想访问外网,该如何访问?

    2013年11月21日 13:25

答案

  • Hi,

    欢迎您来到windows store app开发论坛。

    以下有一段代码您可以参考一下:

    var settingsPane = Windows.UI.ApplicationSettings.SettingsPane.getForCurrentView();
    
        function commandsRequested(eventArgs) {
    
            var applicationCommands = eventArgs.request.applicationCommands;
    
            var privacyCommand = new Windows.UI.ApplicationSettings.SettingsCommand('privacy', 'Privacy Policy', function () {
    
                window.open('http://www.baidu.com/');
    
            });
    
            applicationCommands.append(privacyCommand);
    
        }
    
        settingsPane.addEventListener("commandsrequested", commandsRequested);

    您可以在设置隐私策略的时候访问外部网站资源!

    祝您好运!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    2013年11月25日 13:38
    版主

全部回复

  • 您好,你的问题应该是和商店应用开发有关,我帮你把该问题移到相应的开发论坛,在那里你应该会得到更好更专业的支持。谢谢你的合作!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2013年11月25日 8:33
  • Hi,

    欢迎您来到windows store app开发论坛。

    以下有一段代码您可以参考一下:

    var settingsPane = Windows.UI.ApplicationSettings.SettingsPane.getForCurrentView();
    
        function commandsRequested(eventArgs) {
    
            var applicationCommands = eventArgs.request.applicationCommands;
    
            var privacyCommand = new Windows.UI.ApplicationSettings.SettingsCommand('privacy', 'Privacy Policy', function () {
    
                window.open('http://www.baidu.com/');
    
            });
    
            applicationCommands.append(privacyCommand);
    
        }
    
        settingsPane.addEventListener("commandsrequested", commandsRequested);

    您可以在设置隐私策略的时候访问外部网站资源!

    祝您好运!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    2013年11月25日 13:38
    版主