function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
BrettGusBrettGus 

Resizing Home Page HTML iFrame that displays VF

I am displaying a visualforce page on my home page html component via an iFrame.  This works fine but I'm trying to get it to autoresize based on the content of the iframe.  I was trying to use this code to autoresize inside the iframe 

 

function setHeight() {
    parent.document.getElementById('the-iframe-id').height = document['body'].offsetHeight;
}

 

However, since my main pages is served by salesforce.com and my visualforce page is served by force.com, the browsers won't let me do this cross-site scripting since it violates the security model.  Does anybody know of an alternative way to resize this iframe dynamically?

 

Thanks

Brett

TehNrdTehNrd

As far as I know there is not currently a way to do this. the cross domain thing kills it everytime.