locked
How to load some website like www.bing.com/images into my app automatically? RRS feed

  • Question

  • I have two questions.

    1. In my first page of my app, when user click one icon, it will navigate to second page. In the second page, I am going to use a frame or something to show a webpage like www.bing.com/images. I want the page to be loaded AUTOMATICALLY when the second page is loaded. I don't find a way to do it. <iframe src="http://www.bing.com/images/"><iframe> doesn't work.

    2. In the web page, when user click something, for instance user click one of the image, how do I capture the event and know the URL of the image?

    Thanks.


    Great Wall
    • Edited by GXLPower Friday, February 3, 2012 7:52 AM
    Friday, February 3, 2012 7:12 AM

Answers

  • Hi Great,

    1.  Your <iframe> code should work just fine.  Are you sure your App Manifest specifies InternetClient? Does it work if your iframe is on the first page?

    2.  I do not think there is anyway to accomplish what you want to do.  You cannot intercept the HTTP requests.  Why do you want to know what a customer is clicking on in a frame?  It sounds like you want to create your own web browser like functionality.  If so, a Metro style application would not be the correct platform for you.

    -Jeff


    Jeff Sanders (MSFT)
    Friday, February 3, 2012 2:14 PM
    Moderator
  • Hi Great,

    1.  I think you can avoid this if you are not running in the debugger.  Please try running from the start menu and see if you still get the error.

    2.  You should be able to use the frame 'onload' event to detect when the content is loaded in the frame.

    -Jeff


    Jeff Sanders (MSFT)

    Thursday, February 16, 2012 4:05 PM
    Moderator

All replies

  • Hi Great,

    1.  Your <iframe> code should work just fine.  Are you sure your App Manifest specifies InternetClient? Does it work if your iframe is on the first page?

    2.  I do not think there is anyway to accomplish what you want to do.  You cannot intercept the HTTP requests.  Why do you want to know what a customer is clicking on in a frame?  It sounds like you want to create your own web browser like functionality.  If so, a Metro style application would not be the correct platform for you.

    -Jeff


    Jeff Sanders (MSFT)
    Friday, February 3, 2012 2:14 PM
    Moderator
  • 1. it works now. But when I click some link in the page, app breaks. You can repro very easilly.

    <iframe src=http://www.bing.com/images></iframe>

    Then after the page is load in in frame, click one of the pages. Then you will see break with call stack

    ->getOpacity

    hideNavigation()

    2. But do I know if the iframe load the page? And can I check the current iframe.src? If so, I can workaround


    Great Wall
    • Edited by GXLPower Sunday, February 5, 2012 6:09 AM
    Saturday, February 4, 2012 8:16 AM
  • Hi Great,

    1.  I think you can avoid this if you are not running in the debugger.  Please try running from the start menu and see if you still get the error.

    2.  You should be able to use the frame 'onload' event to detect when the content is loaded in the frame.

    -Jeff


    Jeff Sanders (MSFT)

    Thursday, February 16, 2012 4:05 PM
    Moderator