中の技術日誌ブログ

C#とC++/CLIと
VBと.NETとWindowsで戯れる
 

目次

Blog 利用状況

ニュース

自己紹介

東京でソフトウェアエンジニアをやっています。
お仕事大募集中です。
記事執筆や、講師依頼とかでも何でもどうぞ(*^_^*)
似顔絵 MSMVPロゴ
MSMVP Visual C# Since 2004/04-2013/03

記事カテゴリ

書庫

日記カテゴリ

00-整理

01-MSMVP

javascript:書き込みできません。Permission Deniedがでる。

windowオブジェクトの参照をしている変数に対してobjWin.closedで照会すると書き込みができません。と出る場合があります。

http://groups-beta.google.com/group/microsoft.public.windows.inetexplorer.ie6.browser/browse_thread/thread/5ae4e1329c33091f/9358af25cebad4d1?hl=en

http://support.microsoft.com/kb/918899

要約するとobjWinのプロパティにアクセスすると例外が送出される場合があるけど、それはもうすでに参照先のウィンドウが死んでいる場合なので、closedなものとして扱うようにしませう。

ってことです。

<html>
<script type="text/javascript">
function test()
{
  var objWin = window.open("about:blank", "_blank");
  objWin.close();
  var v = objWin.closed;
}
function test2()
{
  var objWin = window.open("about:blank", "_blank");
  objWin.close();
  var CloseFlag = false;
  try
  {
    var temp = objWin.number;
    CloseFlag = objWin.closed;
  }
  catch(ex)
  {
    CloseFlag = true;
  }
  alert(CloseFlag);
}
</script>
</html>

投稿日時 : 2006年10月25日 14:28

コメントを追加

# re: javascript:書き込みできません。Permission Deniedがでる。 2006/10/26 23:48 inoGUCCI

これ僕もはまりました。
Win2000のIEだとエラーが起こんなくて
XPのIE6、IE7だとエラーが起きるんですよ・・・

子ウィンドウをwindow.openで開いて子画面が
閉じられるのを親画面で監視して、閉じたらsubmitみたいな処理をやったときですが・・・

で、しょうがないから子画面から親画面のjavascriptを呼び出して処理を続行したんですけど・・・
これってやっていいことだったのかいまいち解らないですが
取りあえずエラーも消えたのでよしとしちゃいました

# re: javascript:書き込みできません。Permission Deniedがでる。 2006/12/18 20:48 よしお

同じ状況に陥りネットを検索してここにたどり着きました。
timeoutで回避?できました。
確認したのはXPのIE6.0です。
CPUなどによる処理速度なども影響もあるのでしょうかね。
時間が500msだとエラーが出ることもありました。

/* ===sample=== */
win_id = null;
funcion xxx(){
// window.open()
win_id = window.open.....
}

function winchk(){
if(win_id != null){
if(win_id.closed){
win_id = null;
}
}
setTimeout("winchk()",1000);
}


# re: javascript:書き込みできません。Permission Deniedがでる。 2006/12/18 20:55 よしお

先ほどの情報を出したものですが・・
どうやら、タイミングの問題だったようでして、解決にはなっていないことがわかりました。
現象としては子ウインドウを閉じてから親側でチェックする(closedプロパティ参照の)タイミングが早いとエラーになるようです。
1秒でも2秒でもたまたま子ウインドウチェックのタイミングが子ウインドウが閉じてすぐだと、同じエラーが出るようです。
(チェック間隔が長いと単に出にくいだけ、ということでした)

# http://burberrywalletsale.moonfruit.com 2012/10/26 12:32 Burberry Wallet Sale

I would like to check out.Let me tell you some details about clearance.Show your tickets£¬please.I don't like what you are saying.Enjoy yourself!We arrived in London this afternoon.Any thing else? you make my heart flutter.I promise.Mr. Smith taught English at a school.
Burberry Wallet Sale http://burberrywalletsale.moonfruit.com

# It's going to be finish of mine day, except before end I am reading this fantastic paragraph to increase my know-how. 2019/05/09 13:28 It's going to be finish of mine day, except before

It's going to be finish of mine day, except before end
I am reading this fantastic paragraph to increase my know-how.

# If you want to obtain a good deal from this piece of writing then you have to apply these methods to your won weblog. 2019/05/16 23:15 If you want to obtain a good deal from this piece

If you want to obtain a good deal from this piece of writing then you have to apply these methods
to your won weblog.

# My spouse and I stumbled over here different web page and thought I might as well check things out. I like what I see so i am just following you. Look forward to looking at your web page repeatedly. 2019/08/14 13:40 My spouse and I stumbled over here different web

My spouse and I stumbled over here different
web page and thought I might as well check things out.
I like what I see so i am just following you. Look forward to looking
at your web page repeatedly.

# What a material of un-ambiguity and preserveness of precious knowledge regarding unexpected feelings. 2019/08/18 22:21 What a material of un-ambiguity and preserveness o

What a material of un-ambiguity and preserveness of precious knowledge regarding unexpected feelings.

# What a material of un-ambiguity and preserveness of precious knowledge regarding unexpected feelings. 2019/08/18 22:22 What a material of un-ambiguity and preserveness o

What a material of un-ambiguity and preserveness of precious knowledge regarding unexpected feelings.

# What a material of un-ambiguity and preserveness of precious knowledge regarding unexpected feelings. 2019/08/18 22:23 What a material of un-ambiguity and preserveness o

What a material of un-ambiguity and preserveness of precious knowledge regarding unexpected feelings.

# What a material of un-ambiguity and preserveness of precious knowledge regarding unexpected feelings. 2019/08/18 22:24 What a material of un-ambiguity and preserveness o

What a material of un-ambiguity and preserveness of precious knowledge regarding unexpected feelings.

# It's an awesome post in support of all the internet users; they will take advantage from it I am sure. 2022/03/23 15:26 It's an awesome post in support of all the interne

It's an awesome post in support of all the internet users; they will take
advantage from it I am sure.

# It's an awesome post in support of all the internet users; they will take advantage from it I am sure. 2022/03/23 15:27 It's an awesome post in support of all the interne

It's an awesome post in support of all the internet users; they will take
advantage from it I am sure.

# It's an awesome post in support of all the internet users; they will take advantage from it I am sure. 2022/03/23 15:28 It's an awesome post in support of all the interne

It's an awesome post in support of all the internet users; they will take
advantage from it I am sure.

# It's an awesome post in support of all the internet users; they will take advantage from it I am sure. 2022/03/23 15:29 It's an awesome post in support of all the interne

It's an awesome post in support of all the internet users; they will take
advantage from it I am sure.

# This piece of writing is in fact a fastidious one it helps new the web users, who are wishing for blogging. 2022/03/24 8:50 This piece of writing is in fact a fastidious one

This piece of writing is in fact a fastidious one it helps new the web users, who are
wishing for blogging.

# This piece of writing is in fact a fastidious one it helps new the web users, who are wishing for blogging. 2022/03/24 8:51 This piece of writing is in fact a fastidious one

This piece of writing is in fact a fastidious one it helps new the web users, who are
wishing for blogging.

# This piece of writing is in fact a fastidious one it helps new the web users, who are wishing for blogging. 2022/03/24 8:52 This piece of writing is in fact a fastidious one

This piece of writing is in fact a fastidious one it helps new the web users, who are
wishing for blogging.

# This piece of writing is in fact a fastidious one it helps new the web users, who are wishing for blogging. 2022/03/24 8:53 This piece of writing is in fact a fastidious one

This piece of writing is in fact a fastidious one it helps new the web users, who are
wishing for blogging.

タイトル
名前
URL
コメント