resolve prototype & jquery conflict with dynamic script loading
I know that I can use
to resolve the conflict between prototype and jquery after including all jquery and prototype libraries in the head section. However, I am including another .js file in the head section which dynamically loads a jquery plugin in window.load function. Now I get the conflict. Can someone tell me how to resolve this. Where do I specify the jquery.noConflict()
I suspect it's all in the order:
- load prototype
- load jquery
- run jQuery.noConflict();
- load other js file
edit: oops, you need to include prototype first. (ref)
Where do I specify the jquery.noConflict()
You should put jQuery.noConflict(); just after the line where jQuery library is included.
Load the main jQuery file first of all your .js files.
Then insert the noConflict() - block directly after you load the jQuery library (before any other script files).