<button class="btn btn-success" id="opener" onclick="ValidateReport('<%=generatecampaign%>','<%=loading_img_path%>','<%=IS_HTML%>','Campaign_Report');">Preview</button>
Above is my preview Button
following is my iframe whhich load some html in iframe and resize the iframe with the data in html file which will be loaded in iframe
<div class="bordercolor" id="mydiv" style="display: none; text-align: center">
<IFRAME SRC="" id="reportpreview" style="text-align: center; clear:both;"
marginheight="0" frameborder="0" onLoad="sizeFrame();"></iframe>
<iframe id="myIFrm" src="" style="display: none;"> </iframe>
</div>
Above is my Iframe which is loads the html file in and resize the iframe content as per the html file content...and when there is no html file then simply just load one static html file with one label name as "No data Available"
my problem is when i use chrome and when i want to load the html file..it automaticaly increase the height of iframe 10pt. continously on pressing the preview button.but why its not clear the previous height value when i try to resize the iframe height...
following is my sizeFrame() function in javascript which invoke on iframe onLoad
function sizeFrame() {
var F=null;
F = document.getElementById('reportpreview');
if(F.contentDocument) {
F.height=0;
F.height = F.contentDocument.documentElement.scrollHeight+10; //FF 3.0.11, Opera 9.63, and Chrome
} else {
F.height=0;
F.height = F.contentWindow.document.body.scrollHeight+10; //IE6, IE7 and Chrome
}
}