Hi,
I am using the following javascript to resize an iframe. The top level page is written is classic asp and contains and iframe into which I am loading a control which is written in .net and ajax. The issue is, that the page size is dynamic depending on content, and also takes a while to load. What happens at the moment is that the page loads, the ajax control loads and scroll bars appear till the contents is fully loads, and then it is resized to fit correctly. Obviously it would be nice if the page was the correct size in the first place whilst the ajax finishes loading the content. Is there a precursor to the onload event in classic asp that I can use?
I want to stay away from one of those 'loading page' images.
function autoIframe() {
try {
frame = document.getElementById("browse_frame");
innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
objToResize = (frame.style) ? frame.style : frame;
objToResize.height = innerDoc.body.scrollHeight + 10 + "px";
}
catch (err) {
window.status = err.message;
}
}
window.onload = autoIframe;
Thanks, R.