iframe内でスローされた例外をキャッチするにはどうすればよいですか?
これが私のコードです:
親:
iframe = document.createElement("iframe");
iframe.src = "../a.aspx";
iframe.style.display = "none";
document.body.appendChild(iframe);
およびa.aspx内のコード:
protected void Page_Load(object sender, EventArgs e)
{
GenerateKey();
//This function throws an exception, and I want to catch it in the parent window (javascript)
}
iframeを開いてアラートボックスを表示するページで例外をキャッチしたいと思います。iframe.contentWindow.onerrorを試しましたが、機能しませんでした。
助けてくれてありがとう、
インバル。