0

I have a iframe and should adjust it's size dynamically based on content in it.

I used like this but it's not working.

Thanks

MadProgrammer
  • 343,457
  • 22
  • 230
  • 366
Vinod kumar
  • 129
  • 5
  • 13

1 Answers1

0

Take a look here for lots of good answers and discussion: Resizing an iframe based on content

Long story short, if the iFrame is a cross-domain request you're going to have a bad time. Built-in browser security measures make the content within an iFrame difficult to access (on purpose).

Community
  • 1
  • 1
dug
  • 340
  • 3
  • 7
  • The answer in that question is very out of date, their are a few JS solutions that are much easier to use these days. Check out https://github.com/davidjbradshaw/iframe-resizer – David Bradshaw Apr 21 '15 at 07:24
  • Yeah, that's a great script. However, it still requires a js file to be on both the contained page and the parent page (which could be problematic in some cases). – dug Apr 24 '15 at 20:56