我試圖從iframe的src的ready函數中更改div的innerHTML。下面的代碼。 innerHtml不會改變,但顏色工作正常。想法爲什麼發生這種情況和/或如何解決它?從iframe中更改innerHtml
頁
<html><head></head><body>
<script type="text/javascript" src="Javascript/Import_Subprocess_Content/RAC_Connolly.js"></script>
<div id="importcontent" runat="server">
</div>
<iframe id="frametest" src="./AJAX/Import_Subprocess_Content/RAC_Connolly_ImportSession.aspx">
</iframe>
<div id="popup">FIRST TEXT</div>
</body>
IFRAME SRC
<script type="text/javascript" src="../../Utilities/Javascript/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="../../Javascript/Import_Subprocess_Content/RAC_Connolly.js"></script>
<script type="text/javascript">
$(document).ready(function() {
uploadComplete();
});
</script>
end it!
JS
function uploadComplete() {
window.parent.document.getElementById("popup").innerHtml = "lala";
}
測試在IE7完全。
沒有骰子。當我嘗試不同的屬性時,它會更改除innerhtml之外的所有內容。 – steventnorris