2015-01-04 71 views
0

我沒有與Visual Studio 13經歷了,但是我設法編譯一個簡單的HTML5網站,使其顯示的應用程序。Visual Studio 13,將HTML5網頁重定向到外部網站?

我運行一個網站,我基本上喜歡集成到Windows 8.1 UI應用程序。我試過這樣的代碼:

<!DOCTYPE HTML> 
<html lang="en-US"> 
    <head> 
     <meta charset="UTF-8"> 
     <meta http-equiv="refresh" content="1;url=http://mywebsite.com"> 
     <script type="text/javascript"> 
      window.location.href = "http://mywebsite.com" 
     </script> 
     <title>Page Redirection</title> 
    </head> 
    <body> 
     <!-- Note: don't tell people to `click` the link, just tell them that it is a link. --> 
     If you are not redirected automatically, follow the <a href='http://mywebsite.com'>link to example</a> 
    </body> 
</html> 

但是它給了我一個APPHOST9624錯誤。即使我點擊HREF鏈接失敗。

很顯然,我要對此錯誤的方式,所以我的問題是。如何創建只顯示外部網站全屏的Windows 8.1商店應用程序?

回答

0

編輯:您實際上希望將網站集成到您的商店應用程序中,因此該解決方案對您無效,只是注意到:)儘管所有示例均位於XAML中,但似乎也有WebView Control,因此它可能不會在HTML5應用的支持...

我會建議您啓動與新的URI的默認瀏覽器,儘管這將打開一個新的瀏覽器實例,不知道這是你在你的情況下,想要的東西。爲此,嘗試調用

Windows.System.Launcher.launchUriAsync(uri).done(/* Your success and error handlers */); 

Source

相關問題