locked
'Windows' is undefined in iframe

    Question

  • I have an iframe that runs in web-context and inside it there is a list view. When i use touch to invoke a list view item, an exception is thrown: 

    Unhandled exception at line 15768, column 13 in ms-appx-web://microsoft.winjs.1.0/js/ui.js
    0x800a1391 - JavaScript runtime error: 'Windows' is undefined

    line 15768, column 13 in ms-appx-web://microsoft.winjs.1.0/js/ui.js:

    line 15768, column 13 in ms-appx-web://microsoft.winjs.1.0/js/ui.js

    Do anyone have any experience on how to solve this?

    Wednesday, February 20, 2013 2:19 PM

Answers

  • Web-context is just that. Your iFrame is just a little web browser that's hosted in your app. 

    You don't want any random website to be able to access Windows APIs (and thereby access a user's PC and personal data). Anything you want done in an iframe needs to be written the same way you would write a regular web-app.

    Wednesday, February 20, 2013 7:05 PM

All replies

  • Web-context is just that. Your iFrame is just a little web browser that's hosted in your app. 

    You don't want any random website to be able to access Windows APIs (and thereby access a user's PC and personal data). Anything you want done in an iframe needs to be written the same way you would write a regular web-app.

    Wednesday, February 20, 2013 7:05 PM
  • Aha, that explains it, thanks.

    Wednesday, February 20, 2013 7:41 PM