TypeError: Object #<HTMLDocument> has no method 'observe' issue with the plugin chosen

Posted by NewBoy on Stack Overflow See other posts from Stack Overflow or by NewBoy
Published on 2012-09-16T09:37:03Z Indexed on 2012/09/16 9:37 UTC
Read the original article Hit count: 199

Filed under:
|
|
|

Hi made attempts to install the Jquery plugin chosen which enables me to customise my <select> tag in all browsers. Click here Anyway i have integrated this pluigin into my site and i have come across the following error message in my element inspector..Click here

"TypeError: Object # has no method 'observe'"

from the following code

 <script type="text/javascript">
 document.observe('dom:loaded', function(evt) {
var select, selects, _i, _len, _results;
if (Prototype.Browser.IE && (Prototype.BrowserFeatures['Version'] === 6 || Prototype.BrowserFeatures['Version'] === 7)) {
  return;
}
selects = $$(".chzn-select");
_results = [];
for (_i = 0, _len = selects.length; _i < _len; _i++) {
  select = selects[_i];
  _results.push(new Chosen(select));
}
deselects = $$(".chzn-select-deselect");
for (_i = 0, _len = deselects.length; _i < _len; _i++) {
  select = deselects[_i];
  _results.push(new Chosen(select,{allow_single_deselect:true}));
}
return _results;
 });
 </script>

Does anyone know how i can solve this problem??

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery