1

Generally we get jQuery and prototype.js conflicts in Magento 1.9 Mainly due to jQuery conflicts. Do you have any suggestion to resolve this?

0

I got one solution for it, you follow below instructions:

1) Add jQuery library in your layout xml e.g. page.xml

<action method="addJs"><script>lib/jquery/jquery-1.12.0.min.js</script></action>

2) Add your custom js (in which you are using jQuery) just after jQuery like:

<action method="addItem"><type>skin_js</type><name>js/theme.js</name></action>

3) After that include noconflict.js like:

<action method="addJs"><script>lib/jquery/noconflict.js</script></action>

You should use, default jquery library from js/lib/jquery/jquery-1.10.2.min.js.

So, finally it will look like:

<action method="addJs"><script>lib/jquery/jquery-1.12.0.min.js</script></action>
<action method="addItem"><type>skin_js</type><name>js/theme.js</name></action>
<action method="addJs"><script>lib/jquery/noconflict.js</script></action>

if you are including jQuery through .phtml file instead of xml, then just following above order for files to be included.

Above implementation resolved my issue. I hope it will help you to resolve jQuery conflicts, in this way you could use jQuery and prototype-js as well.

| improve this answer | |
0

Try to use jquery-migrate-3.0.1.js or some of its latest version and include after jquery-1.12.0.min.js.Check following link to download library.

https://github.com/jquery/jquery-migrate
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.