Permission Denied to Set Property XULElement.selectedIndex

Sorry for the late post this week. I have been working hard on the YUI storage project and the new release for and did not finish my post in time. Todays article covers an issue you may experience when using the native DOMElement focus and select functions in FireFox.

If you have FireBug running, the exception is:

"Permission denied to set property XULElement.selectedIndex"

followed by a pointer to the offending line.

The issue is that when you use "element.focus()" and/or "", FireFox attempts to manipulate the built in autocomplete feature. However, it does not always do that correctly. I am not exactly sure what is going on in the FireFox code, but it seems to only happen on fields where the built in browser autocomplete was previously triggered. As long as you do not care about the built in FireFox autocomplete, the fix is very easy, simply add the attribute autocomplete and give it a value of false.

Example 1: In HTML

<input autocomplete="off" type="text" value"some text"/>

Example 2: In JavaScript

element.setAttribute(autocomplete, off);

Example 1 will cause any HTML validator to fail, so you may want to set this attribute via JavaScript (Example 2). Example 2 will fix the issue in FireFox and simply be ignored by other browsers.

Weird Issue with responseXML and JSON in FF3

I recently (like today) upgraded Mint to support FireFox 3. I was not expecting this to be a difficult process, because there is no drastic difference between the JavaScript engines of FF3 and FF2. However, I was surprised to find that many parts of the site did not work. Upon further studied I realized the most peculiar behavior. Upon receiving a JSON response from the server using GetXmlHttpObject(), FF3 populates the XmlHttpObject.responseXML with ...