开发者

Internet Explorer Script Error, Message from Webpage, Permission denied

I'm working with an embedded (Active X?) instance of IE within a VB6 application.

The browser displays demographic information based off the selected person (displayed as a list).

Everything works great until I try to quickly select different people from the list (clicking randomly over different people as fast as I can). After a few clicks, get two errors.

The first is an "Internet Explorer Script Error"

It says:

An Error has occurred in the script on this page

Line:

Char:

Error:

Code:

URL: Do you want to continue running scripts on this page? yes|No

(Line, Char, Error, Code, URL are all blank).

The second error pops up directly over the first.

It says:

"Message from webpage

An error has occurred in this dialog

Error:53 Permission denied"

The page makes multiple ajax calls and also contains several iFrames (I'm thinking these are the cause).

Any advice on how to debug / resolve / avoid the problem would be most appreciated.

Thanks!

EDIT

Here is an image of the error

Internet Explorer Script Error, Message from Webpage, Permission denied

EDIT

I get a JScript anonymous function, No source a开发者_运维百科vailable when I do happen to catch the error.

Internet Explorer Script Error, Message from Webpage, Permission denied

EDIT

I've successfully caught some of the errors. It seems that they are stemming primarily from MicrosoftAjax.js

  • Occurs Consistently: MicrosoftAjax.js - Sys._Application.callBaseMethod(this,"initialize"); Object Expected
  • Occurred Once: jquery-1.4.2.min.js - b.InsertBefore(d,b.firstChild) Object Expected
  • Occurred Once: Out of Memory Exception.

My host application is not using MicrosoftAjax.js at all, but the child iFrame applications are all asp.Net applications.


After a lot of testing and trying to figure out if I really needed to edit MicrosoftAjax.js to fix the problem, I finally found a solution that seems to have resolved the issue.

I added,

<script type="text/javascript">         
  window.onerror = function (e) { return true; }        
</script>

to the header of ever application that I was pulling in via the iFrames, as well as to the parent page. It's been about two days since I made these changes and so far so good (though I'll need a few more days of testing to confirm that it's working 100%).

I had tried this before without success, but that was due to the position of the Script. I had other scripts (like jQuery and MicrosoftAjax) that were positioned before it. Those scripts threw errors before my window.onerror script was even evaluated.

Another interesting thing is that the iFrame errors seem to bubble up regardless of the error handling on the parent page. So I went into our Code repository and made the necessary changes to each of the applications I was pulling in.

Lastly, I want to say thank you to @Jacob for his initial help in troubleshooting this issue.

EDIT

Just wanted to add that I would have preferred to fix the error over burying it, but in the interest of time, this is the solution I've gone with for now.


If you want to just suppress Javascript errors, try setting the Silent property of the WebBrowser to True.


I've found that most of the IE "Permission denied" errors have to do with sharing Javascript objects between windows/frames. Since you produce it with rapid random clicking, I'm guessing this has to do with iframes/windows going away while their content is still being accessed.

One strategy you could use to avoid these problems is to never share any objects between frames. Wherever an object is created, that frame should be responsible for all operations and access to its members. Outside access should be controlled completely through calls to "interface" Javascript functions.


Try

WebBrowser1.ScriptErrorsSuppressed = true;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜