Geoff wrote:
When trying to focus a field in Firefox, I get the following error:
Error: [Exception... "'Permissio n denied to get property
XULElement.sele ctedIndex' when calling method:
[nsIAutoComplete Popup::selected Index]" nsresult: "0x8057001e
(NS_ERROR_XPC_J S_THREW_STRING) " location: "JS frame ::
file:///C:/Documents%20and %20Settings/Edd/Desktop/test.html :: valText
:: line 24" data: no]
Source File: file:///C:/Documents%20and %20Settings/Edd/Desktop/test.html
Line: 24
Anyone have any ideas as to why this is happening?
Thanks
It's happening because you are attempting to do something that is causing an
NS_ERROR_XPC_JS _THREW_STRING error. Without seeing your code, it's
impossible to know what that is. Most likely you are doing nothing wrong,
I'll explain.
I've noticed a similar problem when calling <body onload="window. focus();">
with some windows and not others. And now, testing a window I was opening
that I thought was causing the error, I'm no longer seeing the error, so it
could be caused by some combination of tab variations or installed
extensions in Firefox.
I'm treating it as a bug in Firefox and ignoring the problem.
If you want a more thorough explanation and want to investigate further, I'd
suggest you install Mozilla 1.6 and test, install Mozilla 1.7RC3 and test,
install Mozilla 1.8a and test. Also test on a fresh install of Firefox (no
extensions, no customizations) . Determine in exactly what versions of
Mozilla the problem happens. For example, if it happens in 1.6, but not
1.7RC3, it was a bug they fixed, and you won't see the fix in Firefox until
version 0.9 (RC available and 75% of the size of 0.8 ... yay!). If the
problem happens in Firefox with Tabbrowser Extensions installed, but doesn't
in Firefox with Tabbrowser Extensions not installed, the problem is
Tabbrowser Extensions, etc. If the problem is evident in Mozilla builds up
to 1.8a, then check bugzilla to see if the problem is described there, and
if so, what the status of the bug is.
Unfortunately this sort of thing presents all sorts of problems. I've still
got code where I attach null events to form elements in HTML code because at
one point Mozilla wouldn't bind dynamically assigned event handlers unless
you did that. In other words:
<input type="text" name="myInput" ... onkeypress="">
<script type="text/javascript">
document.forms['myForm'].elements['myInput'].onkeypress = someHandler;
</script>
Just didn't work unless you specifically included [onkeypress=""] in the
HTML. I'm betting I'll never be able to remove that useless HTML attribute
because someone somewhere might be using a version of Mozilla that doesn't
work without it.
--
| Grant Wagner <gw*****@agrico reunited.com>
* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
*
http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
*
http://www.mozilla.org/docs/web-deve...upgrade_2.html