fabiomcosta/mootools-meio-autocomplete — Issue #10: JS error in IE 8
Author: jano-petras
Created: 2011-10-24 09:58:45+00:00
State: open

After an autocompleter has been initialised, and the page is unloaded, JS error is thrown in IE 8.

This is the line in question:

$(global).addEvent('unload', function(){
if (this.node) this.node.set('autocomplete', 'on'); // if autocomplete is off when you reload the page the input value gets erased
}.bind(this));

throwing 'object does not support this property or method' - it is as if the DOM element has lost its mootools bindings and behaves as a plain IE DOM element.

I have found that the script works fine if setting autocomplete to on is wrapped with $, so:

if (this.node) $(this.node).set('autocomplete', 'on');