[英]Inserting HTML to iframe works in Firefox/Chrome/Opera but not in IE7/8
[英]Html form - iframe not working in firefox but works in IE7
我的頁面中有HTML表格,表單和隱藏的iframe。 關於表格column(td)的onclick動作,我正在iframe中呈現pdf文檔。
在IE中,此功能在后續點擊時效果很好。 但是在Firefox中 ,它只能在第一次運行,並且在隨后的點擊中無法使用最新數據刷新iframe。
這是我的示例代碼:
HTML代碼:
<div id="pdfdiv" style="visibility: hidden">
<iframe width="100%" height="100%" scrolling="auto" name="pdfViewer"></iframe>
</div>
使用以下形式調用iframe的JavaScript代碼:
--
--
pdfdiv.style.visibility = "visible";//also set height and width
--
document.forms1.target="pdfViewer";
document.forms1.action="URL";
document.forms1.submit();
在此先感謝您的幫助。
-芒果
代替可見性:隱藏,嘗試“顯示:無”和“顯示:阻止”
看起來正在緩存框架的內容。 解決此問題的一種方法是,如果您控制了服務器端代碼,請在其中添加不緩存:
<head>
<meta http-Equiv="Cache-Control" Content="no-cache">
<meta http-Equiv="Pragma" Content="no-cache">
<meta http-Equiv="Expires" Content="0">
</head>
另一件事要做:
document.getElementById(FrameID).contentDocument.location.reload(true);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.