tags:

views:

17

answers:

2

Hello,

A url is being displayed in a div as shown below

    <div id="ipage">
<? $url = "http://www.yahoo.com"; 
        $file1 = fopen($url, "r");
        $content = file_get_contents($url); 
         echo $content;
?>
    </div>

And I receive this error Webpage error details

Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)

Bright idea to solve this.

Thanks Jean

[EDIT]

I am going to use jQuery here. Is there anyway to hide javascript errors, so the rest of the code excute, without flaws.

+1  A: 

The simplest solution would be to load the page inside an iframe tag instead of a div:

<iframe src="http://www.yahoo.com/"&gt;&lt;/iframe&gt;
Ben James
A: 

Well, I am not sure about the error, but obviously, if you do it this way, you generate HTML that looks like this:

<div id="ipage">
   <html>
      <head>
         <!-- ... -->
      </head>
      <body>
        <!-- ... -->
      </body>
   </html>
</div>

This is not valid HTML so I would not expect the browser to handle such.

Felix Kling
No it does not work either
Jean
@Jean: Well that is what I wanted to say. If you don't tell us what you want to achieve, it is difficult to help. I just wanted to point out, why it is not working and that any approach that generates HTML like this will not work.
Felix Kling
I just want the error to go away or hid the error to execute the rest of the code
Jean