Search code examples
visual-studio-2012microsoft-metrowinjs

want to add iframe in window apps


I just want to add iframe in default.html but it not working showing white page ...

Here my code

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>FinderToday</title>

    <!-- WinJS references -->
    <link href="//Microsoft.WinJS.2.0/css/ui-dark.css" rel="stylesheet" />
    <script src="//Microsoft.WinJS.2.0/js/base.js"></script>
    <script src="//Microsoft.WinJS.2.0/js/ui.js"></script>

    <!-- FinderToday references -->
    <link href="/css/default.css" rel="stylesheet" />
    <script src="/js/default.js"></script>
</head>
<body> 

    <p><a href="ms-appx:///page2.html">Go to page 2</a></p>
    <p><a href="http://www.bing.com">Search the web</a></p>

    <iframe src="http://maps.bing.com" style="width:1366px; height: 768px"></iframe>
</body>
</html>

Solution

  • What version of Windows are you targeting - Windows 8 or Windows 8.1?

    If you are targeting Windows 8.1, use the x-ms-webview element rather than iframe.

    http://msdnstage.redmond.corp.microsoft.com/en-us/library/windows/apps/dn301831.aspx http://blogs.windows.com/windows/b/appbuilder/archive/2013/10/01/blending-apps-and-sites-with-the-html-x-ms-webview.aspx