Prototype in no conflict mode

391 views
Skip to first unread message

Alastair Young

unread,
Apr 29, 2013, 11:54:26 AM4/29/13
to prototype-s...@googlegroups.com
I need to move my code (Prototype 1.7.1) into someone else's much larger project using jQuery v1.5.1.

Can I load Prototype in no-conflict mode ? I can't change any of the jQuery stuff.

Thanks

-alastair

Walter Lee Davis

unread,
Apr 29, 2013, 12:05:06 PM4/29/13
to prototype-s...@googlegroups.com


On Apr 29, 2013, at 8:54 AM, Alastair Young <alastai...@gmail.com> wrote:

I need to move my code (Prototype 1.7.1) into someone else's much larger project using jQuery v1.5.1.

Can I load Prototype in no-conflict mode ? I can't change any of the jQuery stuff.

Not as far as I know. The issue as I understand it is that Prototype extends the (lower-case) prototype of a number of JS primitives, and these extensions are an issue for jquery, over and above the simple name collision between $ in both libraries. Can you modify the HTML? You may be able to inject the jquery noConflict() function call in between the link to jquery and the subsequent links to various scripts and plugins that rely on it. That still won't fix things if those scripts are written in a style that doesn't expect to be in the presence of noConflict, though.

Walter


Thanks

-alastair

--
You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scripta...@googlegroups.com.
To post to this group, send email to prototype-s...@googlegroups.com.
Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Alastair Young

unread,
Apr 29, 2013, 12:22:02 PM4/29/13
to prototype-s...@googlegroups.com
I can't modify the HTML - I fear my only solution is port all my code to jQuery 

Walter Lee Davis

unread,
Apr 29, 2013, 12:28:02 PM4/29/13
to prototype-s...@googlegroups.com


On Apr 29, 2013, at 9:22 AM, Alastair Young <alastai...@gmail.com> wrote:

I can't modify the HTML - I fear my only solution is port all my code to jQuery 


Before you do that, try this. Download a copy of the prototype source cod locally, and use find-and-replace to substitute another character, like the underscore, for $. Do the same in a fork of your code. See if that does anything useful. It may. 

Walter 

Alastair Young

unread,
Apr 29, 2013, 12:34:16 PM4/29/13
to prototype-s...@googlegroups.com
What if I ran my stuff in a frame - would jquery still conflict if it's loaded in the topmost frame?

Walter Lee Davis

unread,
Apr 29, 2013, 12:39:18 PM4/29/13
to prototype-s...@googlegroups.com


On Apr 29, 2013, at 9:34 AM, Alastair Young <alastai...@gmail.com> wrote:

What if I ran my stuff in a frame - would jquery still conflict if it's loaded in the topmost frame?

I was going to suggest that as an option, but I didn't know if you shared my disdain for I frames or not. 
Reply all
Reply to author
Forward
0 new messages