Bug Tracker

Opened 17 years ago

Closed 17 years ago

Last modified 16 years ago

#119 closed bug (invalid)

Calling focus from "script" tag after load() throws error (SVN Rev 169)

Reported by: tfs7 @… Owned by:
Priority: major Milestone:
Component: ajax Version:
Keywords: Cc:
Blocked by: Blocking:

Description

Got this error in Firebug as a result of this code in the script:

[Exception... "'Permission denied to set property XULElement.selectedIndex' when calling method: [nsIAutoCompletePopup::selectedIndex]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "JS frame :: http://rdv/js/jquery.js :: anonymous :: line 4433" data: no]

Request order:

I made an AJAX call via load(), and the injected page has a set of script tags in it with a call to focus on the first form element. Here is the script for reference:

<script type="text/javascript"> /* <![CDATA[ */ $.id('frsearchName').focus(); $('#frserachForm').ajaxForm('#ajaxConfirm', function(){

showConfirm('Request sent!')

}); /* ]]> */ </script>

The use of the $.id plugin with just a plain old js focus() causes the error in firebug.

Attachments (1)

prototype.js (60.4 KB) - added by anonymous 16 years ago.

Download all attachments as: .zip

Change History (2)

comment:1 Changed 17 years ago by john

Resolution: invalid
Status: newclosed

This is a Firefox bug - Firefox has some serious issues with focus/blur on form elements. I highly recommend that you wrap it in a try{ ... } catch(e){}, just to avoid it for now.

Changed 16 years ago by anonymous

Attachment: prototype.js added
Note: See TracTickets for help on using tickets.