1

I have included all the js library in page.xml of my magento.

<action method="addJs"><script>lib/jquery/jquery-1.10.2.min.js</script></action>
            <action method="addJs"><script>lib/jquery/noconflict.js</script></action>
            <action method="addJs"><script>prototype/prototype.js</script></action>
            <action method="addJs"><script>prototype/validation.js</script></action>
            <action method="addJs"><script>lib/ccard.js</script></action>
            <action method="addJs"><script>scriptaculous/builder.js</script></action>
            <action method="addJs"><script>scriptaculous/effects.js</script></action>
            <action method="addJs"><script>scriptaculous/dragdrop.js</script></action>
            <action method="addJs"><script>scriptaculous/controls.js</script></action>
            <action method="addJs"><script>scriptaculous/slider.js</script></action>
            <action method="addJs"><script>varien/js.js</script></action>
            <action method="addJs"><script>varien/form.js</script></action>
            <action method="addJs"><script>mage/translate.js</script></action>
            <action method="addJs"><script>mage/cookies.js</script></action>

after that also my prototype.js is not working. I have used noconflict.js also. It was working properly before. After merging the js files it is giving the errors.

  • only noconflict.js this will not work you have to replace variable $ with jQuery – Qaisar Satti Apr 29 '16 at 7:21
  • What should I have to do then? As I am very new to magento and javascript – Asheem Patro Apr 29 '16 at 7:29
  • 1
    add this var jQuery=$.noConflict(); in start of file every jquery related file. and replace every $ with jQuery – Qaisar Satti Apr 29 '16 at 7:38
1

only noconflict.js this will not work you have to replace variable $ with jQuery add this var jQuery=$.noConflict(); in start of file every jquery related file. and replace every $ with jQuery

  • There are a lot of js files how it is possible to change all $ with jQuery. – Asheem Patro Apr 29 '16 at 7:52
  • you have to otherwise conflict still there. – Qaisar Satti Apr 29 '16 at 7:55
  • I have replaced all $ with jQuery but it still conflicting – Asheem Patro Apr 29 '16 at 8:44
  • Previously some how it was working now totally stopped working. – Asheem Patro Apr 29 '16 at 8:45
  • i think you added some new files you need to replace it there. – Qaisar Satti Apr 29 '16 at 11:00
1

go ahead and add the contents of noconflict.js directly at the end of your jquery file , this will ensure that it gets executed right after jquery is loaded

  • I have added the noconflict.js also but it is conflicting – Asheem Patro Apr 29 '16 at 7:28
  • @Anton S, please provide me more detail. I also faced the problem. When I merge and minify JS file, a lot of jQuery Conflict are occurred. Do I need to add noconflict.js at end of the local.xml file? – D3ad L0cK Sep 28 '16 at 9:53
  • you need to understand what is causing the conflict, adding something to somewhere is meaningless hack that won't get you far – Anton S Sep 28 '16 at 11:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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