0

私は、parent.error.document.write("hi") を使用して 3 つのフレームを持つフレームセットを使用しています。同じことをすることは可能ですか?

4

2 に答える 2

1

Without seeing your code I can only guess possible reasons.

  1. You have ids in <frame>s instead of names.

  2. You've created content to the target frame using document.write() already, without document.close(). In this case the document is not cleared when writing again.

  3. Document in target frame has been loaded from different domain.

If there's nothing to repair according the list above, you can try to refer frameTwo-document with top.window.frameTwo.document, or top.window.frames['frameTwo'].document.

于 2012-05-09T18:22:33.893 に答える
0

2 つのフレームが次のようになっているとします。

<frameset framespacing="0" rows="*"> 
       <frame name="frameOne" src="frame1.html">
       <frame name="frameTwo" src="frame2.html">
</frameset>

frameOne 内から、次の方法で frameTwo にアクセスできるはずです。

window.parent.frameTwo.document
于 2012-05-09T17:24:46.030 に答える