Is it possible to handle conflicts between 2 versions of jQuery loaded in the same page? Assume that two applications (from different developers that know nothing of each other) share the same canvas (page) and each one of the developers is allowed to register global JavasScript libraries on the page. If each developers registers a different version of Jquery how could the hosting page handle conflicts?
We have a similar problem. We can not control how the primary owner of the page uses jquery or what version they have. Plus we would like to include our own version of jquery and jquery libraries/plugins and may need to do it later in the page load than the page owner does.
It seems that the noConflict must be called on the first loading of jquery which in our case can't happen since we don't control the first loading of jquery.
Assuming one way or another we get the jquery no conflict working, how do we then use our own version of jquery-ui with our version of jquery and not conflict with the potential of the page owner including another version of jquery-ui.
I have this little ditty that injects a jQuery version of your choice within a page and isolates it, giving control back to the original jquery. You could use it to wrap jQuery ui assuming you use some build scripts for your js files within the isolate() method maybe? http://github.com/quickredfox/jQuery-Quarantine.
But keep in mind not much time was spent on this code and I'm still not convinced there isn't a better way to get around the/your/my injectional hazard.
Hi.. I am facing a similar issue where I am using a jquery for images effects and another for autocomplete on the same page.. Now the issue is that if i put all the autocomplete scripts after image effects then autocomplete works fine else if i put image effects scripts after autocomplete, then image effects works fine..
I want both to work on the same page.. Below are the scripts that i have put in the HEAD section..
//.parallax(xPosition, speedFactor, outerHeight) options: //xPosition - Horizontal position of the element //inertia - speed to move relative to vertical scroll. Example: 0.1 is one tenth the speed of scrolling, 2 is twice the speed of scrolling //outerHeight (true/false) - Whether or not jQuery should use it's outerHeight option to determine when a section is in the viewport $('#intro').parallax("50%", 0.1); $('#second').parallax("50%", 0.1); $('.bg').parallax("50%", 0.4); $('#third').parallax("50%", 0.3);
}) </script><!-- parallax efect sonu -->
Leave a comment on ctutan's reply
Change topic type
Link this topic
Provide the permalink of a topic that is related to this topic