0

I have a rather tricky problem. I work with a client who are restricted to only use HTML, CSS and JavaScript. We have build a form using PHP and Javascript - and currently we only find it possible to embed the form using an iFrame. We have no FTP-access, so the iFrame is loaded from a different domain.

While the form use JavaScript to load new questions and results, this makes it difficult for the height to fit the screen. If the frame fits some of the screens, it will cut off some elements on other screens. While I am unable to upload any files to the FTP that contains the iFrame, it is not possible to use the helper-file solution, as described here.

So, my question is: is it possible to add a JavaScript action that change the css of the iFrame height, when a specific div id is loaded / action executed?

Thanks in advance! :)

EDIT: I decided to solve this differently. But in case anyone else will stumble across this post, I think the solution offered here might work (if the code is updated to fit the latest jQuery). The main problem in my case seemed to be the limited access to the client domain.

Community
  • 1
  • 1
  • 3
    Possible duplicate of [Resizing an iframe based on content](http://stackoverflow.com/questions/153152/resizing-an-iframe-based-on-content) – Abhijeet Feb 01 '16 at 11:04
  • I actually read through this post and tried to implement it on their server. However, I am not allowed to upload a helper-filer to the domain. – mathiasmadsen Feb 01 '16 at 11:41

1 Answers1

0

You can't control the parent window document property if the iframe is from different domain. How ever you can try busting out of the iframe.

https://css-tricks.com/snippets/javascript/break-out-of-iframe/