You need to sign in to do that
Don't have an account?
Mike @ Partners
Custom tab help.
I have a custom tab that calls a page on my server. I need to resize the tabs iframe using javascript so i dont get two scroll bars. The problem is every code i try i get "Error: uncaught exception: Permission denied to get property ..." as an error. Is there any way to do this?
Thanks for the help,
Mike
Thanks for the help,
Mike
here is some that I found laying around :
function resizeIframe() {
var iframe = parent.document.getElementById(sControlId);
if(iframe != undefined){
var height = document.body.scrollHeight;
iframe.style.height = height + 'px';
}
}
but, you also need the sControlId, so try this:
var scontrolUrl = "{!Scontrol.URL}";
var index = scontrolUrl.indexOf("file=");
sControlId = scontrolUrl.substring(index + 5);
This method relys on knowing the name of the parent iframe, so may change in the future, but you get the idea, there are other ways to get the parent element.
Code:
I noticed on your code that you were referring to a sControl. i am using a custom tab that links to my server. I dont have a sControl ID to work with. Any ideas? I still am getting 'Error: uncaught exception: Permission denied to get property HTMLDocument.getElementById'
It almost seems that the javascript on my pages (saved on my servers) cant access the pages on salesforces servers. Is there anyway around this?
Thank you for the help.
Mike
you can configure (in salesforce ) your web tab to open a large window, then your app won't hit the bottom of the parent frame, so you won't have that pesky second scroll bar ? no?