Skip to main content

Bug Tracker

Side navigation

#119 closed bug (invalid)

Opened August 05, 2006 02:05PM UTC

Closed August 06, 2006 07:16PM UTC

Last modified June 20, 2007 02:13AM UTC

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

Reported by: tfs7 @ excite dot co 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 October 17, 2006 08:40PM UTC.
Change History (1)

Changed August 06, 2006 07:16PM UTC by john comment:1

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.