7

I have created a page in which I am showing A websites Page (situated some where on web );

I used iframe but puzzled with the height issues I solved width issues for 950px only with css3 but my need is full height as target website but that is not working with cross domain pages (I've done with same domain successfully).

Now I want to do it either with PHP using get_file_content() or some other putting it into div , iframe or in frames whatever works (and also pages must be accessible as it is from main sites)

The container will change its content with hyper link click.

Please help me to resolve the issues. I've tried many more methods including jquery, js, php, css and blah blah blah with no success.

before commenting or answering please visit THIS LINK

I need some thing like this

Please check this and alter here To See My page Click here

Note:

  1. I have no access of target site so I can't put attributes on target page and get back to iframe page.

  2. I have 100+ pages to show so no specific method can be used i need any generalized technology.

  3. One more thing i don't want scrolling in my page.

Efforts done :

Ajax/Jquery

PHP Resize

Community
  • 1
  • 1
Trikaldarshiii
  • 11,174
  • 16
  • 67
  • 95
  • You need to watch this talk on seamless iframes: http://www.youtube.com/watch?v=gQCm8VYn93Y it explains a lot of workaround to get content in iframes to play nice with the parent page. – Ivan Zuzak Dec 12 '12 at 11:27

2 Answers2

0

Do something like this:

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

If you do that it should look like this picture

jackcogdill
  • 4,900
  • 3
  • 30
  • 48
0

In the "iframe'd" html, have:

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

and in the page that 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 padding etc.

Note that they have to be under the same domain for this to work, otherwise you might have to run:

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

On either or both. This is required so that the browser may interact between them.

Robin Castlin
  • 10,956
  • 1
  • 28
  • 44