ポップアップの親の親にイベントを添付します。ポップアップの親の親にイベントを添付するにはどうすればいいですか?
をForm1のiframeを含む(マスターページ)が(マスターページなし)のForm2を開くポップアップを開く - :
階層は次のようです。
私はJavascript.How経由のForm2によって開くポップアップで、Form1を確認したい、私はそれを行うのですか?
それはForm2のためにのみ機能します。 attachEvent
はIE /オペラだけで
// if you're opening Form2 from outside the iframe
window.opener.opener.document.attachEvent("onclick",setfocus);
// if you're opening Form2 from inside the iframe
window.opener.opener.parent.document.attachEvent("onclick",setfocus);
注ことなので、あなたが期待するならば、これはクロスブラウザを動作するように:すべてはsame hostname, protocol, and port number上にあり、窓は閉じられていない場合にのみ
window.opener.document.attachEvent("onclick",setfocus);
:「window.opener.opener.parentは」オブジェクトがnullであるか、ありません – Dee