Hi List! I am using the latest version of prototype.js from the SVN, including the wonderful $$ operator to loop through a number of elements with a certain classname. In Firefox everything works fine, no JS error, but in IE I get an error in the .each function saying that an Object was expected. What I do is function initializePlugins() { $$(".plugin").each(function(plugin) { // do something } } within that function some events are observed. The error occurs in the catch block of the following function: var Enumerable = { each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != $continue) throw e; } }); } catch (e) { if (e != $break) throw e; } }, Did anyone run into that error? Help anyone? Thank you smi
On 2/9/06, smi <smi-KNx8rLYEdFWsTnJN9+BGXg@public.gmane.org> wrote:> I am using the latest version of prototype.js from the SVN, including > the wonderful $$ operator to loop through a number of elements with a > certain classname. In Firefox everything works fine, no JS error, but in > IE I get an error in the .each function saying that an Object was expected.> Did anyone run into that error? Help anyone?http://dev.rubyonrails.org/ticket/3715 I just submitted a patch to fix $$() on IE. I''m comfortable in JavaScript and am familiarizing myself with Prototype, but in order to understand what''s happening in the Selector code, you have to be a Prototype mastermind. It actually seems like it''s using a slightly different coding convention; I hope that gets cleaned up before the next Prototype release. What a pain. Todd
Hi Todd! You''re awesome! That fixed my bug, It''s working for me now. Thanks Michael Todd Ross schrieb:> On 2/9/06, smi <smi-KNx8rLYEdFWsTnJN9+BGXg@public.gmane.org> wrote: >> I am using the latest version of prototype.js from the SVN, including >> the wonderful $$ operator to loop through a number of elements with a >> certain classname. In Firefox everything works fine, no JS error, but in >> IE I get an error in the .each function saying that an Object was expected. > >> Did anyone run into that error? Help anyone? > > http://dev.rubyonrails.org/ticket/3715 > > I just submitted a patch to fix $$() on IE. I''m comfortable in > JavaScript and am familiarizing myself with Prototype, but in order to > understand what''s happening in the Selector code, you have to be a > Prototype mastermind. > > It actually seems like it''s using a slightly different coding > convention; I hope that gets cleaned up before the next Prototype > release. > > What a pain. > > Todd > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
On 2/11/06, smi <smi-KNx8rLYEdFWsTnJN9+BGXg@public.gmane.org> wrote:> You''re awesome! That fixed my bug, It''s working for me now.I know you didn''t file the ticket, but I would encourage you to add a comment to the ticket that the patch resolved your problems with the $$() function including what browsers you were able to test it in. A Safari or Opera test would be awesome if you have either of those available. http://dev.rubyonrails.org/ticket/3715 Todd