Conflict with ajax library

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Having trouble viewing these files, did they get deleted?
kmcgrail
Beginner
Beginner
Posts: 7
Joined: Thu May 25, 2006 9:26 pm
Contact:

Post by kmcgrail »

Andy wrote:Having trouble viewing these files, did they get deleted?
I moved them to our devel-errors after our private correspondence but I have added a redir so that the files at http://www.thoughtworthy.com/ajax-milonic-error are available once more.

Thanks for looking into this!
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Just had a closer look and the problem appears to be on line 1507 of prototype-1.5.0.rc0.js

The code is:

Code: Select all

var parameter = Form.Element.Serializers[method](element);
There is nothing obvious in the menu that is causing this conflict so I'm at a loss as to why the Serializers function is being deleted. It appears to be fine if the menu is removed but only present if the menu builds.

Sorry I can't help but I must put this down to an issue with the Prototype script.
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Try the Pre Release now - Think I've found it
kmcgrail
Beginner
Beginner
Posts: 7
Joined: Thu May 25, 2006 9:26 pm
Contact:

Post by kmcgrail »

Andy wrote:Just had a closer look and the problem appears to be on line 1507 of prototype-1.5.0.rc0.js

The code is:

Code: Select all

var parameter = Form.Element.Serializers[method](element);
There is nothing obvious in the menu that is causing this conflict so I'm at a loss as to why the Serializers function is being deleted. It appears to be fine if the menu is removed but only present if the menu builds.

Sorry I can't help but I must put this down to an issue with the Prototype script.

If you reload the index.html page which has both prototype & milonic enabled and mouse over the place where Home Page is on the milonic menu at the top, you'll notice the error is on 1506 in that instance.

This leads me to believe that perhaps a collision occurs because of a call that is triggering the call to Form.Element.getValue; in prototype.

For example, prototype uses

Code: Select all

var $F = Form.Element.getValue;
Milonic uses

Code: Select all

function $F(v){if(_d.getElementById)return _d.getElementById(v);
Possible that these variables slamming might be the source of the confliction?

Since Milonic is (essentially) closed source, as a customer and programmer, I would suggest any public functions or variables really should be like Function $milonic_F. The use of shorthand variables for a non-API js is likely to always cause headaches. You are probably doing it for obfuscation purposes but doing so is likely to cause Milonic to lose potential customers because prototype is VERY popular.

I know right now as much as I enjoy Milonic, our powers that be will choose to keep Prototype and shelve Milonic if the issue isn't solved. I also think other clients, existing and potential, will do the same. This means less customers for Milonic, pure and simple which is unfortunate because outside of the javascript collisions with prototype, it is a great product that has served us well.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

Did you try the pre-release as Andy suggested?

Ruth
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

$F has been removed from the menu now.

As Ruth suggests, the Pre Release will probably be OK now.

Cheers,
Andy
kmcgrail
Beginner
Beginner
Posts: 7
Joined: Thu May 25, 2006 9:26 pm
Contact:

Post by kmcgrail »

Andy wrote:$F has been removed from the menu now.

As Ruth suggests, the Pre Release will probably be OK now.

Cheers,
Andy
Apologies to Ruth. I was writing my response during the time that Andy also found the problem and prior to his posting about the pre_release so the chronology is skewed. I was not weighing in on the pre release as yet.

However, Andy's research and mine concur that the collision with $F was the problem. I have tested the v5.752 pre release and happy to report that the problem is resolved as far as I can tell.

http://www.thoughtworthy.com/downloads/ ... rerelease/

We'll sacrifice a few interns to try and appease the prototype gods from doing this again.

Thanks,
KAM
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Apologies to Ruth
Oh, I'm sure she won't mind :P


From what I can gather the conflicts are all based around the "Dollar Capitol" letter variable names. We use them like that to keep the variable names short and because we assumed nobody else would use this method.

So, in the future we know where to look. It would be fantastic if you could get the guys at Prototype to use variable $pF instead of $F - It's only one extra character and if we guarantee NOT to use this method we should be OK for the future.
kmcgrail
Beginner
Beginner
Posts: 7
Joined: Thu May 25, 2006 9:26 pm
Contact:

Post by kmcgrail »

Andy wrote:It would be fantastic if you could get the guys at Prototype to use variable $pF instead of $F - It's only one extra character and if we guarantee NOT to use this method we should be OK for the future.

I think to get $pF implemented for Prototype would be like derailing a freight train because this would change Ruby on Rails as well. Pun intended but as I said, I think that changing an API (or programming language) versus a closed-source program is going to continually come back to the closed-source program. Heck, it took me this long to figure out it was $F collision!

Regards,
KAM
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Point and pun taken :D

I'm of the opinion though that the variables are internal to Prototype and so may not affect anything. Although, I'm only guessing and could be completely wrong.

Let's leave it then and see what happens.

Hopefully Prototype will settle down and changes will become less frequent in the future
kmcgrail
Beginner
Beginner
Posts: 7
Joined: Thu May 25, 2006 9:26 pm
Contact:

Post by kmcgrail »

Andy wrote:Point and pun taken :D

I'm of the opinion though that the variables are internal to Prototype and so may not affect anything. Although, I'm only guessing and could be completely wrong.
Agree that things should settle down but as an FYI, based on the quite excellent documentation Sergio did at http://www.sergiopereira.com/articles/prototype.js.html I believe these to be external variables for functions.

Regards,
KAM
Post Reply