【问题标题】:Open system browser with some java script Windows Phone 8.1使用一些 java 脚本打开系统浏览器 Windows Phone 8.1
【发布时间】:2015-06-02 18:43:56
【问题描述】:

有没有办法通过在其中插入一些我在字符串中的java脚本代码来打开系统浏览器?

【问题讨论】:

    标签: javascript c# .net windows-phone-8.1 windows-8.1


    【解决方案1】:

    来自MSDN

    // The URI to launch
    var uriToLaunch = "http://www.bing.com";
    
    // Create a Uri object from a URI string 
    var uri = new Windows.Foundation.Uri(uriToLaunch);
    
    // Launch the URI
    Windows.System.Launcher.launchUriAsync(uri).then(   
       function (success) {
          if (success) {
            // URI launched
          } else {
            // URI launch failed
          }
       });
    

    【讨论】:

      【解决方案2】:

      不可能。当您将 WebView 嵌入到您的应用程序时,您只能导航到您的字符串。外部浏览器只能通过 Url 启动。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-12-21
        • 2013-08-02
        • 1970-01-01
        • 2022-01-12
        • 1970-01-01
        • 2015-03-26
        相关资源
        最近更新 更多