Prototype.js Effects May Fail in New Firefox 2.0.0.6

<Update> Please, excuse me for too much buzz. The problem was actually with changes in CCS I made. at the same time as I updated Firefox. I couldn't even imagine that problem could be caused by that, as i just added a couple classes that DO NOT interfere with damaged page in any way. I was mad when I found it.

The CSS provided by some designer I don't know (my cliend hired him to make layout, and I received ready-made layout from my client) and he's a damn lucky guy. Sometimes I want to kill all the lame coders. The only thing that stops me is upderstanding that I also do lame things more or less frequently.

I am very thankful for feedback provided by everyone who commented this article and especially to jQuery developer Rey Bango who contacted me directly. Sorry again for misspelling your name, Rey!

The original article follows. </Update>

There is a feature in called Spy at one of my sites. It was inspired by digg's spy and, in fact, I borrowed some code from there.

TorrentMan Spy was introduced more that a year ago and worked nearly flawlessly until now. Two days ago everything was fine, but today my client reported a bug at that page: instead of moving “endless tape” of items the items just desappeared one by one untill the page was empty. Firebug shown a lot of errors around the line 1300 of prototype.js, mostly too much recursion at 1294.

My first reaction was: “Who is that son of a bitch who made changes to production scripts behind my back?”. Then I saw all the related files intact since last summer and reminded that I've updated Firefox to 2.0.0.6 just yesterday. And so did my client.

A few breakpoints helped me to locate the root of all evil. I have a code like that to make new item appear at the top of the list:

newItem.style.display =  'none';
spytable.insertBefore(newItem, oldItem);
new Effect.Appear(newItem);

Stepping in i finally came to that to much recursion error at line 1294.

I'm unsure yet if it's a bug or a feature, and if it's a bug I don't know yet if it's my bug or prototype.is'. I suspect it could be my bug, as I'm not a big JS Guru, and digg spy still works flawlessly, though it uses older prototype.js and FadeIn effect instead of appear. I had to turn eye-candy off until I fix it.

If it's really a prototype.js bug, I'll file a bug report and write more here.

Check your javascript, don't leave your users one-to-one with broken pages.

Top Top  AddThis Social Bookmark Button

Category: work Words: javascript, prototype.js, Effect.Appear, firefox 2.0.0.6, bug

Disabled

David G. Paul

I don't think it is a prototype bug. I've got the same sort of code being used extensively in a web app and it's unaffected by the update to FF 2.0.0.6.

According to Mozilla, 2.0.06 only updates:

* MFSA 2007-27 Unescaped URIs passed to external programs

* MFSA 2007-26 Privilege escalation through chrome-loaded about:blank windows

02.08.2007 // 19:16 [ Link ]

Reply from author

Thanks for reply, I'm quite busy right now, so haven't check changelogs and bugzillas yet, just found the bug, worked it around and posted and article here. Later I'll research more deeply. Thanks for saving some time for me.

Regards, Aleksei

02.08.2007 // 19:29 [ Link ]

kangax

This is a common issue when using older scriptaculous with new prototype (1.5.1 vs 1.5.0)

Installing both prototype 1.5.1 and latest scriptaculous should fix this

03.08.2007 // 07:07 [ Link ]

Reply from author

I do have latest versions of both (prototype.js 1.5.1.1 and scriptaculous 1.7.0), but, alas, the problem is here. I'll try to find what exactly the problem is and file a bug report or fix my own bugs and write a post on that.

03.08.2007 // 09:34 [ Link ]

Guillaume

Hi,

I think kangax is right, you should use script.aculo.us 1.7.1 beta 3 with prototype 1.5.1.

03.08.2007 // 11:05 [ Link ]

Dr Pranad Venkapuram

Yes this threw me for a sec before noticing I had to move to 1.7.1 beta 3

05.08.2007 // 02:04 [ Link ]

Sergey

I can confirm that:

Firefox 2.0.0.6

Prototype 1.5.1.1

Scriptaculous 1.7

getting 'recursion error' on my effect pulsate.

After updating of scriptaculous lib to 1.7.1 beta 3 everything is working. Thanks.

10.09.2007 // 12:44 [ Link ]

Comment Deleted
Comment Deleted
Comment Deleted
Comment Deleted
Comment Deleted
Comment Deleted
Comment Deleted