-3

My object is to remove the scrollbars of an iframe for cross domain servers, which I don't have access to.

  • Page A has an iframe which displays contents of an external server
  • The content is not fixed, its height changes with time so I can not fix the height, it has to be dynamic.
  • It has to be handled with JavaScript. I have a list of objects corresponding to the users selection. When a different selection is made, different content types are shown.

I have tried to a solution with postMessage, but it does not solve the problem as I don't have access to the server. I was thinking more of a view, which resizes the iframe when the page is loaded.

Whymarrh
  • 13,139
  • 14
  • 57
  • 108

1 Answers1

1

You can't. There is no way to determine the size of a page in a cross-domain iframe without explicit support from scripts running on that page. Since you've already said that you can't modify that page, there's no way to do this.

  • i was thinking more of a automatic script on a separate thread which will adjust the view after page is loaded.... i am new to this , is there a kind of view to handle it? – Digvijay Bahree Oct 08 '14 at 14:31
  • No. Nothing you do on your page can get the size of a page in a cross-domain frame. Threads have nothing to do with it. –  Oct 08 '14 at 20:06