Display cross domain page inside div, iframe, frame with original height?

I created a page on which I display a website page (located somewhere on the Internet);

I used an iframe, but puzzled by height issues. I solved the width problems for 950px with css3 only, but my need is full height as the target site , but this does not work with cross-domain pages (I successfully executed with the same domain.

Now I want to do this either with PHP using get_file_content() , or with another, putting it in a div, iframe or in frames everything that works ( as well as the pages should be accessible as the main sites are )

The container will change its content using a hyperlink.

Please help me solve the problems. I tried many more methods including jquery , js , php , css and blah blah blah without success,

Before commenting or responding, please visit THIS LINK

I need something like this

Please check this and change here. View my page. Click here.

Note:

  • I donโ€™t have access to the target site, so I canโ€™t put the attributes on the target and return to the iframe page.

  • I have another 100 pages to show that no specific method can be used. I need some kind of generic technology.

  • Another thing that I don't want to scroll on my page.

Actions taken:

Ajax / jquery

PHP resizing

+7
source share
2 answers

In the "iframe'd" html:

 <body onload="parent.resize_iframe(document.body.scrollHeight)"> 

and on the page - iframes:

 <script type="text/javascript"> function resize_iframe(new_height) { document.getElementById('iframed').style.height = parseInt(new_height, 10) + 60 + 'px'; } </script> 

I used 60px to fix potential fill, etc.

Please note that they must be in the same domain for this to work, otherwise you may need to run:

 <script type="text/javascript"> document.domain = "domain.com"; </script> 

On one or both. This is necessary so that the browser can interact between them.

+1
source

Do something like this:

 <frameset rows="*"> <frame frameborder=0 src="http://www.discountautoparts.com/" scrolling="auto" noresize> </frameset> 

If you do, it should look like a picture

0
source

All Articles