opensubscriber
   Find in this group all groups
 
Unknown more information…

m : mozilla-xpcom@mozilla.org 3 January 2006 • 11:30PM -0500

Re: XPConnect problem
by Martin Honnen

REPLY TO AUTHOR
 
REPLY TO GROUP






Petar Popara wrote:

> Sometimes, on some (Windows) PCs, I got this error message:
>
> Error: myObj.myFunc is not a function
> Source file: file:///C:/Test/test.html
> Line: 27

> <embed type="application/myapp-plugin" width=1 height=1 hidden="true">
> <script>
> function DoSomething()
> {
> var myObj = document.embeds[0];
> if (myObj == null)
>     alert("null!");
> else
>     alert("not null!");
>
> var x = myObj.myFunc();

> The problem is that this happens only somethimes and not allways. :( Why?
> How can I debug it?

When are you calling that function that tries to access the method that
plugin exposes? Consider to wait until
   window.onload
respectively
   <body onload
has fired so that the DOM with the embed element object has been built
_and_ that plugin has been loaded so that it can expose its methods.


--

Martin Honnen
http://JavaScript.FAQTs.com/
_______________________________________________
Mozilla-xpcom mailing list
Mozilla-xpcom@mozi...
http://mail.mozilla.org/listinfo/mozilla-xpcom

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.