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 prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---