I dont know what I am doing to be getting this. I have read somewhere that it may be an bug in firefox (which is what I am using by the way), but I am not sure. Based on how illogical the error is it may well be true.
Anyhow, I have a javascript call in the onLoad event of my <body> tag. Just a simple setfocus. If I add a second command after it, even a simple alert, it throws back the following error.
Error: [Exception... "'Permission denied to get property XULElement.selectedIndex' when calling method: [nsIAutoCompletePopup::selectedIndex]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "JS frame :: <unknown filename> :: onload :: line 0" data: no]
It has me stumped. Any ideas why this would be so?
[SOLVED] Annoying Illogical Javascript Error
Moderator: General Moderators
[SOLVED] Annoying Illogical Javascript Error
Last edited by Stryks on Sun Jan 02, 2005 1:41 am, edited 1 time in total.
Thanks for the reply feyd.
I seem to have it working without any errors now but I really dont know why.
Basically I just switched the calls around, so instead of having:
I now have:
and it all works without the error.
Of course, the purpose wasnt really to have the alert in there, so I replaced it with my function and it all works the way it was supposed to (the original problem was happening for my function so I simplified the call until I wound up calling alert to test it).
Go figure.
I seem to have it working without any errors now but I really dont know why.
Basically I just switched the calls around, so instead of having:
Code: Select all
onLoad="document.postcode_add.form_postcode.focus(); alert("hi");"Code: Select all
onLoad="alert("hi"); document.postcode_add.form_postcode.focus();"Of course, the purpose wasnt really to have the alert in there, so I replaced it with my function and it all works the way it was supposed to (the original problem was happening for my function so I simplified the call until I wound up calling alert to test it).
Go figure.