If other libraries or js code extend the native objects with the same
methods, the one included last wins.  In this case, it will almost
always be prototype because he is loading it dynamically.

On Jul 10, 1:04 pm, Matt Foster <mattfoste...@gmail.com> wrote:
> Besides the $ function and using for(var in ) for iteration over an
> array.  I can't think of other conflicts prototype would cause with
> existing code.
> --
> http://positionabsolute.net
> On Jul 10, 2:41 pm, Josh Powell <seas...@gmail.com> wrote:
> > You cannot safely add Prototype to the target pages.  Prototype
> > changes javascript in general, not just jQuery.  It adds methods to
> > native objects. If the target pages are already running jQuery in
> > noConflict() mode then you won't interfere, but if you put their pages
> > in noConflict() mode then you will mess up their javascript that
> > relies on it.  There could also be custom code that relies on for
> > (each in obj) that will break if you add prototype, and there is no
> > way to check for that.
> > You will also be breaking pages that use mootools, which does not have
> > a noConflict() mode.
> > Prototype does not have a noConflict() mode because the theory behind
> > it prevents that from happening, once native objects are extended
> > there is no way to unextend them.  You are going to have to use jQuery
> > or Dojo for this project if you want to add a library to their pages.
> > Probably jQuery as it only adds the jQuery variable to the global
> > namespace, and even then you should use noConflict() mode and return
> > the $ to its previous state before exiting your code, so in case they
> > are using jQuery you give them back use of $ before you are done.
> > If you want to do the least potential damage by adding Prototype to
> > others pages, then check to make sure it doesn't already exist, and
> > then check to make sure $ doesn't already exist, and if it does
> > disable any special effects or give a warning saying that this feature
> > cannot be used because it will interfere with the existing code.
> > Good luck!
> > On Jul 9, 12:10 pm, Diodeus <diod...@gmail.com> wrote:
> > > I am working on a content delivery solution. This would allow people
> > > to include some content on their page by adding a script tag. I would
> > > like to add some slickness to the content, so I would like to use
> > > Prototype.
> > > I'm looking for some suggestions to safely add Prototype to the target
> > > pages (I'm inserting a script tag dynamically) without interfering
> > > with an existing copy of Prototype, jQuery or other libraries.
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to