I'm working on some JavaScript that will be embedded on other websites (think like Google Analytics or AdSense). There is some hardcore JS being done -- AJAX requests, animations, JSON(P).
I've written the prototype using jQuery, and really want to keep using it, but this might cause a problem when embedded on the other sites if they also have jQuery installed -- probably even a different version.
Is there a nice way around this? The best solution I've got so far is to simply replace all occurrences of jQuery
with kQuery
, and $
with $kQuery
, so there is no naming conflict. Any suggestions? How can I be as compatible as possible with their existing JavaScript?