Conflict with ajax library

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
matt_
Beginner
Beginner
Posts: 1
Joined: Mon Sep 12, 2005 5:35 pm

Conflict with ajax library

Post by matt_ »

We recently started using your menus, version 5.729, and all was going well until I tried to integrate it with the Prototype ajax library http://prototype.conio.net/ and Prototype no longer works because its most basic function is $(). I realized you make heavy use of the dollar sign in your obfuscated code. I tried doing a find/replace in your code to change the dollar signs to something else, but no dice. Is there anything that I can do? I don't want to give either of these components up.
Thanks.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi Matt,

I was hoping someone would answer this. I believe you'll have to contact Milonic about this issue. It's not something we can really do on a forum, especially since you're not supposed to modify the program files. I'm sure they can work a solution for you.

Ruth
rav4ski
Advanced
Advanced
Posts: 18
Joined: Wed Sep 08, 2004 1:42 am

AJAX is getting more pouplar

Post by rav4ski »

Hi,

My company also has a corp. license of Milonic. (Thanks to me, of course. :P ). We are using it and very satisfied with the product and support.

Currently, a huge re-design is going on and we are looking forward to extend the usage of Milonic menu. In addition, I think the AJAX is getting so popular and it will be part of the solutions that we are looking for as well.

I will start testing the AJAX in a couple of weeks. I hope the Milonic and AJAX can co-exist w/o conflicting to each others since both of them are considered as the most sophisticated usage of the Java Scripts.
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

The menu should work fine with AJAX but will depend on the implementation.

If there are any problems please let me know and I'll do what I can.

With regard to http://prototype.conio.net/ I'm going to need to see this problem first hand, if you can create a demo using both the menu and the http://prototype.conio.net/ AJAX script, I'll find the conflict and change it.

Hope this helps,
Andy
dpetrie
Beginner
Beginner
Posts: 4
Joined: Mon Oct 10, 2005 8:53 pm

Post by dpetrie »

I can confirm having issues with Milonic menu and prototype as well. The errors were coming from the ${} function. I am going to try and put together a demo that you can trouble-shoot. I would encourge others to do the same.

Prototype is a very powerful scripting library that, along with script.aculo.us, is gaining huge popularity. Making Milonic compatible would give developers a complete arsenal. I plan to use both once an update is implemented.
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Making Milonic compatible would give developers a complete arsenal
We'll do what we can - let me know as soon as the problem is visible.

Who so you think should back down on the variable name though Us or Them?

--- Andy
dpetrie
Beginner
Beginner
Posts: 4
Joined: Mon Oct 10, 2005 8:53 pm

Post by dpetrie »

I submitted a ticket (#6202) moments ago with an example of the issue. Prototype is becoming a very popular scripting library for web developers and I doubt if they would be receptive to such an implementation change at this point.

Hopefully a change on this end would not be that intrusive.
jball
Beginner
Beginner
Posts: 4
Joined: Tue Oct 11, 2005 6:09 pm

Post by jball »

The prototype library is a very popular standard for implementing ajax which comes from ruby on rails. One of their core overloads for an element accessor is function $(). It would be unreasonable for the prototype makers to change this as it is an external function and used by many sites, whereas the obfuscation of this menu library is purely internal and should not effect any existing implementations.

Personally I evaluated the Milonic menu system for my company recently and noticed its incompatability with prototype; hence I moved on to find another menu system that was compatable. Today by chance I found this forum posting and I am very interested in a speedy resolution to this issue as I would very much like to purchase and implement this menu system with my ajax library.

In terms of recreating the problem, simply add (this is by hand so there may be a typo)

Code: Select all

<script src="http://prototype.conio.net/dist/prototype-1.3.1.js"></script>
to an existing menu implementation
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Hi All,

The Pre Release version of the menu found at http://milonic.com/menuvinfo.php contains a fix for the rouge variable.

This version will become final release within the next few days.

Please let me know if you find any problems and I'll get right onto it

Hope this helps
Andy
dpetrie
Beginner
Beginner
Posts: 4
Joined: Mon Oct 10, 2005 8:53 pm

Post by dpetrie »

Thank you Andy.

I will try this immediately and provide feedback as soon as possible! I am every excited about having these two products coexist.

Again, thanks.
dpetrie
Beginner
Beginner
Posts: 4
Joined: Mon Oct 10, 2005 8:53 pm

Post by dpetrie »

Andy I have done some preliminary testing and everything seems to be working fine using the pre-release you provided. I tested some of the prototype/script.aculo.us functionality with no incident.

I will report any issues as they come up.

Thank you.
jball
Beginner
Beginner
Posts: 4
Joined: Tue Oct 11, 2005 6:09 pm

Post by jball »

Great! I'll try as soon as I get home tonight as well and let you guys know.
jball
Beginner
Beginner
Posts: 4
Joined: Tue Oct 11, 2005 6:09 pm

Post by jball »

I downloaded the prerelease version and it works fine with prototype. Thanks for the quick response, you'll get getting a cheque soon :)
shiroh
Beginner
Beginner
Posts: 1
Joined: Wed Jan 11, 2006 12:02 am

Post by shiroh »

It looks like there is another conflict. The new prototype library (1.4) includes the $H() function for emulating Hash elements which conflicts with functions in the mmenudom.js file. :(
Schekky
Beginner
Beginner
Posts: 1
Joined: Thu Feb 02, 2006 5:14 pm

Same Issue

Post by Schekky »

I am encountering the same issue with prototype.js and the Milonic menu not playing nice together. Are there any plans to fix this? The menu is great, but part of the system that I am building requires AJAX.
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Hi All,

I have removed the variable $H from the menu.

I'm not sure how long we can go without the menu and Prototype conflicting again.

I'm also not sure why we should change our variable names too. Can't they meet us half way and change some of their variables? We used $H first so why should we change?

If somebody can contact them and see if we can try and eliminate future conflicts that would be great.

Cheers,
Andy
undetected
Beginner
Beginner
Posts: 1
Joined: Tue Mar 21, 2006 12:26 am

Post by undetected »

I'm not sure how long we can go without the menu and Prototype conflicting again.
I think the answer is simple, though not easy: start using namespaces. Both Milonic and Prototype are guilty of modifying the global namespace, of course, but since you don't control the Prototype code, maybe you can do something about it with the Milonic code.

This way you'd avoid any conflict with any other Javascript library (or even any existing Javascript code a future customer could have).
kmcgrail
Beginner
Beginner
Posts: 7
Joined: Thu May 25, 2006 9:26 pm
Contact:

Collision w/Prototype 1.5.0-rc0 and Milonic

Post by kmcgrail »

Using Prototype 1.5.0-rc0 and Milonic Version 5.747, I'm seeing another collision between the two libraries.

Specifically Form.Element.Serializers[method] is not a function at line 1507 in prototype-1.5.0-rc0.js

Subsequent mouse overs on the blank menu give an error of Element has no properties at Line 1506 in prototype-1.5.0-rc0.js

getValue: function(element) {
element = $(element);
var method = element.tagName.toLowerCase(); <-- 1506
var parameter = Form.Element.Serializers[method](element); <-- 1507

if (parameter)
return parameter[1];
}
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

After looking at the code I think it's unlikely to be related to our menu, there is nothing in there that points to anything we have done.

I'm getting the impression that the guys from prototype are doing this on purpose now.

I;m also getting reluctant to change our code every time they release a fix. Milonic was around LONG before AJAX was invented so who really is to blame for all of this? - It's debatable.

Can I ask you to take it up with them, this is not a "Cop Out" just a request to see if they can cut us some slack, if not come back to us and we'll see what we can do.
kmcgrail
Beginner
Beginner
Posts: 7
Joined: Thu May 25, 2006 9:26 pm
Contact:

Conflict with Prototype & Milonic

Post by kmcgrail »

Andy wrote:Can I ask you to take it up with them, this is not a "Cop Out" just a request to see if they can cut us some slack, if not come back to us and we'll see what we can do.
The issue seems to be boiling down to "Why should Milonic change and not Ajax/prototype"? I hear you and I give a high amount of credence to this complaint. I'm pretty sure they AREN'T breaking it on purpose but I know it must feel that way.

The 3 answer(s) I have developed after researching and pondering the issue is that A) IDEAL: both should change to have non-conflicting namespaces or function names , B) REALISTIC?: that Milonic and Prototype should work to minimize these problems going forward and that C) NECESSARY: Milonic should change in the meantime because it's code is proprietary and commercial giving a higher level of response requirements to customer than an open source project.

It's hard for me to open a ticket with Ruby/Prototype because people can't view/edit milonic's code nor really even easily debug it to pinpoint the problem because it is heavily obfuscated. If you can give me some pointers as to what the bug is, I'll happily open a ticket at http://dev.rubyonrails.org/. Though, Andy, I'd suggest that you might have more weight in posting a ticket. NOTE: I have kids, own a business and work with open source a lot so I understand the difficulty of balancing releasing your work and still paying your bills. This is NOT a proprietary / closed source vs. open source debate.

Anyway, I've put up a set of simple test pages to demonstrate the incompatibility:

The index page http://www.thoughtworthy.com/ajax-milon ... index.html has both Prototype and Milonic enabled.

The second page http://www.thoughtworthy.com/ajax-milon ... lonic.html has the <script> call for prototype changed to <disscript>.

The third page http://www.thoughtworthy.com/ajax-milon ... otype.html has the <script> calls for milonic changed to <disscript>.

Regards,
Kevin A. McGrail
Post Reply