在父文件中我有:
<p id="successmsg">Text.</p>
<iframe src="file.php" name="calcFrame"></iframe>
在file.php里面是:
<script>
jQuery(window.parent.document).ready(function() { jQuery('<p>Text to be inserted.</p>').insertAfter('#successmsg'); });
</script>
该脚本没有任何影响。我试过jQuery(文档)。我不确定我需要做什么,如window.parent.document让jQuery知道id在父页面内。
答案 0 :(得分:2)