Loading ...
Sorry, an error occurred while loading the content.

iframe inside panel - firefox

Expand Messages
  • ioannis.arapakis
    I am trying to access the contents of an iframe (viewed with Firefox), which is inside a panel that I call dynamically. On a test page I tried something
    Message 1 of 3 , May 28 10:18 AM
    • 0 Attachment
      I am trying to access the contents of an iframe (viewed with Firefox),
      which is inside a panel that I call dynamically. On a test page I
      tried something similar and it worked..but inside my panel it's not
      working.

      I have used the following code to access the iframe's contents:

      alert('YAHOO.util.Dom.get('panelFrame').contentDocument.innerHTML');

      or instead:

      alert('document.getElementById('panelFrame').contentDocument.innerHTML');

      You can have a look at the sample page on this ip:
      http://130.209.253.158:42705/instant_browser/index.php

      Just type a query and then click to any of the results to open the
      panel. if you press the ESCAPE button to close the panel then two
      alert messages are activated. The first one is notifying that a second
      message should follow that shows the content of the iframe (as you can
      see in the code above)..but no second alert box appears...Any ideas on
      that?

      Thanks
    • ioannis.arapakis
      Sorry, but I forgot to leave the server on; therefore the url that I posted wasn t accessible. I ll make sure I leave it running for 1-2 days, starting from
      Message 2 of 3 , May 29 4:13 AM
      • 0 Attachment
        Sorry, but I forgot to leave the server on; therefore the url that I
        posted wasn't accessible. I'll make sure I leave it running for 1-2
        days, starting from today...
      • ioannis.arapakis
        I have dealt with content reloading in the iframe. However, in order to highlight text inside the page that s dynamically loaded in the iframe I need to get
        Message 3 of 3 , May 29 8:10 AM
        • 0 Attachment
          I have dealt with content reloading in the iframe. However, in order
          to highlight text inside the page that's dynamically loaded in the
          iframe I need to get the html content of that page first. That usually
          works with something like:

          var iframeContent =
          document.getElementById('panelFrame').contentDocument.body.innerHTML;

          However, I noticed that this works only for pages that have been
          stored locally. For example, if I set my iframes src="test_page.htm"
          (test_page.htm is an html page that I have saved on my desktop) than I
          can successfully retrieve the html content of that page, process it
          (that is highlight the words that I want) and reload it in the iframe.
          If I enter as a source page a url (e.g.
          http://www.cbvcp.com/c2/madonna.html) then I get nothing. It's like I
          don't have access to that page and can't retrieve its html code, even
          though I can load the page inside my iframe.

          Any ideas on that?
        Your message has been successfully submitted and would be delivered to recipients shortly.