We are writing a SaaS like solution that requires our customers to SCRIPT SRC some javascript code we are building (think Google Analytics scenario). We would like to use JQuery. However, since our customers might already have conflicting JQuery versions or other conflicting frameworks (prototype.js for one) we cannot tell them to source jquery.js.
We were thinking of coping the jquery source as to create a ‘private’ jquery instance and simple search/replace the JQuery and $ functions with myJQuery and $J
Is there any reason for this not to work? has anyone tried something like this? What can we do about plugins?
You should be able to achieve this using jQuery.noConflict()
This though doesn’t fix the plugin problem: