How to add Jquery in Magento? Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?running jquery with no conflict inside CMS pagesIncluding Jquery in magento conflict the prototype.jsjQuery optimized load for module, using only one file (layout)Edit jQuery to Change Color of MenuMagento admin form date widget week number differs from jquery UI week numberCustom jQuery dont workMultiple Jquery Version for extension reasonAdd jQuery plugin without for whole site without a module (Magento 2)Adding jQuery doesn't seem to do anythingMagento2 add custom jquery pluginjQuery conflict in owlcarouselusing jQuery-ui accordion in checkout pageAdding Jquery to block (Still a nooblet)

Putting class ranking in CV, but against dept guidelines

Show current row "win streak"

Trying to understand entropy as a novice in thermodynamics

How to write capital alpha?

What is a more techy Technical Writer job title that isn't cutesy or confusing?

Co-worker has annoying ringtone

What would you call this weird metallic apparatus that allows you to lift people?

"klopfte jemand" or "jemand klopfte"?

Can you force honesty by using the Speak with Dead and Zone of Truth spells together?

Is openssl rand command cryptographically secure?

Why weren't discrete x86 CPUs ever used in game hardware?

Why datecode is SO IMPORTANT to chip manufacturers?

How do living politicians protect their readily obtainable signatures from misuse?

Can an iPhone 7 be made to function as a NFC Tag?

New Order #6: Easter Egg

NERDTreeMenu Remapping

Tannaka duality for semisimple groups

Asymptotics question

Where is the Next Backup Size entry on iOS 12?

Universal covering space of the real projective line?

Is CEO the "profession" with the most psychopaths?

Is multiple magic items in one inherently imbalanced?

What does 丫 mean? 丫是什么意思?

How does the math work when buying airline miles?



How to add Jquery in Magento?



Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?running jquery with no conflict inside CMS pagesIncluding Jquery in magento conflict the prototype.jsjQuery optimized load for module, using only one file (layout)Edit jQuery to Change Color of MenuMagento admin form date widget week number differs from jquery UI week numberCustom jQuery dont workMultiple Jquery Version for extension reasonAdd jQuery plugin without for whole site without a module (Magento 2)Adding jQuery doesn't seem to do anythingMagento2 add custom jquery pluginjQuery conflict in owlcarouselusing jQuery-ui accordion in checkout pageAdding Jquery to block (Still a nooblet)



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








10















In my current project in about us page I need to add tabs to switch between different section I know this can be done by Jquery tabs but I don't know how to do this when integrating with magento.










share|improve this question






























    10















    In my current project in about us page I need to add tabs to switch between different section I know this can be done by Jquery tabs but I don't know how to do this when integrating with magento.










    share|improve this question


























      10












      10








      10


      4






      In my current project in about us page I need to add tabs to switch between different section I know this can be done by Jquery tabs but I don't know how to do this when integrating with magento.










      share|improve this question
















      In my current project in about us page I need to add tabs to switch between different section I know this can be done by Jquery tabs but I don't know how to do this when integrating with magento.







      magento-1.9 magento-1 jquery






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 16 at 11:58









      7ochem

      5,86493770




      5,86493770










      asked Nov 27 '14 at 7:00









      don7don7

      631314




      631314




















          5 Answers
          5






          active

          oldest

          votes


















          1














          Assuming you created a CMS Page already and name of that page is About Us this name should be included in if ($headBlock->getModuleName() == 'Mage_Page' && $headBlock->getTitle() =='your_page_name'):



          Now add this code in your app/design/frontend/your_package/your_theme/template/page/html/head.phtml



          <?php $headBlock = $this->getLayout()->getBlock('head');
          if ($headBlock->getModuleName() == 'Mage_Page' && $headBlock->getTitle() =='About Us'):
          ?>
          <link rel="stylesheet"href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
          <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
          <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
          <script type="text/javascript">jQuery.noConflict();</script>
          <script type="text/javascript"> jQuery(function() jQuery( "#tabs" ).tabs(); );</script>
          <?php endif; ?>


          Then open content section of your CMS Page.



          <div style="float: right; width: 200px;">&nbsp;
          <p>block type="tag/popular" template="tag/popular.phtml"</p>
          </div>
          <div id="tabs" style="width: 680px;">
          <ul>
          <li><a href="#tabs-1">You text here.</a></li>
          <li><a href="#tabs-2">You text here.</a></li>
          <li><a href="#tabs-3">You text here.</a></li>
          </ul>
          <div id="tabs-1">
          <p>You text here.</p>
          </div>
          <div id="tabs-2">
          <p>You text here.</p>
          </div>
          <div id="tabs-3">
          <p>You text here.</p>
          <p>You text here.</p>
          </div>
          </div>


          paste this code and this will create jquery tabs in your frontend.Hope this helps.



          here is a reference link if you have any doubts.






          share|improve this answer























          • thankyou this worked

            – don7
            Nov 27 '14 at 7:11






          • 3





            Adding scripts and custom tags to the head.phtml file is against Magento's best practices. The new script tags should be added via layout xml and you can add custom update handles to the about us page to target that page specifically. The script tags should be broken out into it's own javacript file as well and imported via layout xml as well.

            – Tyler Craft
            Jan 21 '15 at 16:20


















          6














          I wouldn't suggest to edit your head.phtml template for this. Most of the times you don't need a custom head template in your own theme because the core one is already doing its job.



          Also personally I don't like to write code that's based on exceptions (if A then do this, if B then do this). If you need a lot of different javascripts on a lot of different pages, then your head.phtml would be filled with a lot of if statements.



          I would suggest to add jQuery through layout XML. With CMS pages you have the ability to add extra layout XML in the admin when editing the page. Here you find an example setting a different template to the about us page. In the same way you can add jQuery to the about us page. Add this layout XML:



          <reference name="head">
          <action method="addItem">
          <type>skin_js</type>
          <script>js/jquery-1.x.x.js</script>
          </action>
          <block type="core/text" name="jquery.noconflict">
          <action method="setText">
          <text><![CDATA[<script type="text/javascript">var $j = jQuery.noConflict();</script>]]>
          </text>
          </action>
          </block>
          </reference>





          share|improve this answer






























            4














            Or just simple copy to you theme dir, like skinfrontend[your theme]defaultjs and add this to your theme's page.xml:



            <action method="addItem">
            <type>skin_js</type>
            <script>js/jquery-1.9.1.min.js</script>
            </action>





            share|improve this answer
































              3














              Okay I have found a way to make prototype, jQuery and bootstrap work without interfering with each other and without using jQuery.noConflict(). My layout setup (page.xml) was following(stripped for easier read):



              <block type="page/html_head" name="head" as="head">
              <action method="addJs"><script>prototype/prototype.js</script></action>
              <action method="addJs"><script>lib/ccard.js</script></action>
              <action method="addJs"><script>prototype/validation.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>varien/menu.js</script></action>
              <action method="addJs"><script>mage/translate.js</script></action>
              <action method="addJs"><script>mage/cookies.js</script></action>
              <action method="addJs"><script>buzzthemes/buzz-intro/jquery.min.js</script></action>
              <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/bootstrap.js</script></action>
              <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/responsive-tabs.js</script></action>
              <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/clickable.js</script></action>
              <block type="page/js_cookie" name="js_cookies" template="page/js/cookie.phtml"/>
              <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/site.js</script></action>
              </block>


              I was getting errors like following:




              TypeError: element.attachEvent is not a function



              element.attachEvent("on" + actualEventName, responder);



              TypeError: element.dispatchEvent is not a function



              element.dispatchEvent(event);




              I did not want to change $ everywhere. So, I made three javascript files as follows:




              proto_to_temp.js having following code:




              var $tempPrototypeDollar = $;



              after_jquery.js having following code:




              $ = jQuery;



              after_all.js having following code:




              $ = $tempPrototypeDollar;


              As you can probably guess already, the first script assigns current $ variable (owned by prototype) to a temporary variable called $tempPrototypeDollar. Second script simply assigns jQuery to $. Third script assigns the content of $tempPrototypeDollar back to $.



              I included these three scripts in the following order:



              <block type="page/html_head" name="head" as="head">
              <action method="addJs"><script>prototype/prototype.js</script></action>
              <action method="addJs"><script>lib/ccard.js</script></action>
              <action method="addJs"><script>prototype/validation.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>varien/menu.js</script></action>
              <action method="addJs"><script>mage/translate.js</script></action>
              <action method="addJs"><script>mage/cookies.js</script></action>
              <action method="addJs"><script>buzzthemes/buzz-intro/conflict/proto_to_temp.js</script></action><!-- First Script goes just before jQuery include-->
              <action method="addJs"><script>buzzthemes/buzz-intro/jquery.min.js</script></action>
              <action method="addJs"><script>buzzthemes/buzz-intro/conflict/after_jquery.js</script></action><!-- Second Script goes just after jQuery include-->
              <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/bootstrap.js</script></action>
              <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/responsive-tabs.js</script></action>
              <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/clickable.js</script></action>
              <block type="page/js_cookie" name="js_cookies" template="page/js/cookie.phtml"/>
              <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/site.js</script></action>
              <action method="addJs"><script>buzzthemes/buzz-intro/conflict/after_all.js</script></action><!-- Third Script goes after all jQuery related code has been included -->
              </block>


              This solved all the problems for me and now jquery, bootstrap and prototype, all seem to work fine.






              share|improve this answer






























                2














                Include the following in the top of the design page



                <script>
                var $j = jQuery.noConflict();
                </script>


                And use jQuery as $j instead of $(Eg:$j('.class').hide();)



                PS: You can use any other variable instead of j in var $j






                share|improve this answer

























                  Your Answer








                  StackExchange.ready(function()
                  var channelOptions =
                  tags: "".split(" "),
                  id: "479"
                  ;
                  initTagRenderer("".split(" "), "".split(" "), channelOptions);

                  StackExchange.using("externalEditor", function()
                  // Have to fire editor after snippets, if snippets enabled
                  if (StackExchange.settings.snippets.snippetsEnabled)
                  StackExchange.using("snippets", function()
                  createEditor();
                  );

                  else
                  createEditor();

                  );

                  function createEditor()
                  StackExchange.prepareEditor(
                  heartbeatType: 'answer',
                  autoActivateHeartbeat: false,
                  convertImagesToLinks: false,
                  noModals: true,
                  showLowRepImageUploadWarning: true,
                  reputationToPostImages: null,
                  bindNavPrevention: true,
                  postfix: "",
                  imageUploader:
                  brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                  contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                  allowUrls: true
                  ,
                  onDemand: true,
                  discardSelector: ".discard-answer"
                  ,immediatelyShowMarkdownHelp:true
                  );



                  );













                  draft saved

                  draft discarded


















                  StackExchange.ready(
                  function ()
                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f45569%2fhow-to-add-jquery-in-magento%23new-answer', 'question_page');

                  );

                  Post as a guest















                  Required, but never shown

























                  5 Answers
                  5






                  active

                  oldest

                  votes








                  5 Answers
                  5






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes









                  1














                  Assuming you created a CMS Page already and name of that page is About Us this name should be included in if ($headBlock->getModuleName() == 'Mage_Page' && $headBlock->getTitle() =='your_page_name'):



                  Now add this code in your app/design/frontend/your_package/your_theme/template/page/html/head.phtml



                  <?php $headBlock = $this->getLayout()->getBlock('head');
                  if ($headBlock->getModuleName() == 'Mage_Page' && $headBlock->getTitle() =='About Us'):
                  ?>
                  <link rel="stylesheet"href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
                  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
                  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
                  <script type="text/javascript">jQuery.noConflict();</script>
                  <script type="text/javascript"> jQuery(function() jQuery( "#tabs" ).tabs(); );</script>
                  <?php endif; ?>


                  Then open content section of your CMS Page.



                  <div style="float: right; width: 200px;">&nbsp;
                  <p>block type="tag/popular" template="tag/popular.phtml"</p>
                  </div>
                  <div id="tabs" style="width: 680px;">
                  <ul>
                  <li><a href="#tabs-1">You text here.</a></li>
                  <li><a href="#tabs-2">You text here.</a></li>
                  <li><a href="#tabs-3">You text here.</a></li>
                  </ul>
                  <div id="tabs-1">
                  <p>You text here.</p>
                  </div>
                  <div id="tabs-2">
                  <p>You text here.</p>
                  </div>
                  <div id="tabs-3">
                  <p>You text here.</p>
                  <p>You text here.</p>
                  </div>
                  </div>


                  paste this code and this will create jquery tabs in your frontend.Hope this helps.



                  here is a reference link if you have any doubts.






                  share|improve this answer























                  • thankyou this worked

                    – don7
                    Nov 27 '14 at 7:11






                  • 3





                    Adding scripts and custom tags to the head.phtml file is against Magento's best practices. The new script tags should be added via layout xml and you can add custom update handles to the about us page to target that page specifically. The script tags should be broken out into it's own javacript file as well and imported via layout xml as well.

                    – Tyler Craft
                    Jan 21 '15 at 16:20















                  1














                  Assuming you created a CMS Page already and name of that page is About Us this name should be included in if ($headBlock->getModuleName() == 'Mage_Page' && $headBlock->getTitle() =='your_page_name'):



                  Now add this code in your app/design/frontend/your_package/your_theme/template/page/html/head.phtml



                  <?php $headBlock = $this->getLayout()->getBlock('head');
                  if ($headBlock->getModuleName() == 'Mage_Page' && $headBlock->getTitle() =='About Us'):
                  ?>
                  <link rel="stylesheet"href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
                  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
                  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
                  <script type="text/javascript">jQuery.noConflict();</script>
                  <script type="text/javascript"> jQuery(function() jQuery( "#tabs" ).tabs(); );</script>
                  <?php endif; ?>


                  Then open content section of your CMS Page.



                  <div style="float: right; width: 200px;">&nbsp;
                  <p>block type="tag/popular" template="tag/popular.phtml"</p>
                  </div>
                  <div id="tabs" style="width: 680px;">
                  <ul>
                  <li><a href="#tabs-1">You text here.</a></li>
                  <li><a href="#tabs-2">You text here.</a></li>
                  <li><a href="#tabs-3">You text here.</a></li>
                  </ul>
                  <div id="tabs-1">
                  <p>You text here.</p>
                  </div>
                  <div id="tabs-2">
                  <p>You text here.</p>
                  </div>
                  <div id="tabs-3">
                  <p>You text here.</p>
                  <p>You text here.</p>
                  </div>
                  </div>


                  paste this code and this will create jquery tabs in your frontend.Hope this helps.



                  here is a reference link if you have any doubts.






                  share|improve this answer























                  • thankyou this worked

                    – don7
                    Nov 27 '14 at 7:11






                  • 3





                    Adding scripts and custom tags to the head.phtml file is against Magento's best practices. The new script tags should be added via layout xml and you can add custom update handles to the about us page to target that page specifically. The script tags should be broken out into it's own javacript file as well and imported via layout xml as well.

                    – Tyler Craft
                    Jan 21 '15 at 16:20













                  1












                  1








                  1







                  Assuming you created a CMS Page already and name of that page is About Us this name should be included in if ($headBlock->getModuleName() == 'Mage_Page' && $headBlock->getTitle() =='your_page_name'):



                  Now add this code in your app/design/frontend/your_package/your_theme/template/page/html/head.phtml



                  <?php $headBlock = $this->getLayout()->getBlock('head');
                  if ($headBlock->getModuleName() == 'Mage_Page' && $headBlock->getTitle() =='About Us'):
                  ?>
                  <link rel="stylesheet"href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
                  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
                  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
                  <script type="text/javascript">jQuery.noConflict();</script>
                  <script type="text/javascript"> jQuery(function() jQuery( "#tabs" ).tabs(); );</script>
                  <?php endif; ?>


                  Then open content section of your CMS Page.



                  <div style="float: right; width: 200px;">&nbsp;
                  <p>block type="tag/popular" template="tag/popular.phtml"</p>
                  </div>
                  <div id="tabs" style="width: 680px;">
                  <ul>
                  <li><a href="#tabs-1">You text here.</a></li>
                  <li><a href="#tabs-2">You text here.</a></li>
                  <li><a href="#tabs-3">You text here.</a></li>
                  </ul>
                  <div id="tabs-1">
                  <p>You text here.</p>
                  </div>
                  <div id="tabs-2">
                  <p>You text here.</p>
                  </div>
                  <div id="tabs-3">
                  <p>You text here.</p>
                  <p>You text here.</p>
                  </div>
                  </div>


                  paste this code and this will create jquery tabs in your frontend.Hope this helps.



                  here is a reference link if you have any doubts.






                  share|improve this answer













                  Assuming you created a CMS Page already and name of that page is About Us this name should be included in if ($headBlock->getModuleName() == 'Mage_Page' && $headBlock->getTitle() =='your_page_name'):



                  Now add this code in your app/design/frontend/your_package/your_theme/template/page/html/head.phtml



                  <?php $headBlock = $this->getLayout()->getBlock('head');
                  if ($headBlock->getModuleName() == 'Mage_Page' && $headBlock->getTitle() =='About Us'):
                  ?>
                  <link rel="stylesheet"href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
                  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
                  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
                  <script type="text/javascript">jQuery.noConflict();</script>
                  <script type="text/javascript"> jQuery(function() jQuery( "#tabs" ).tabs(); );</script>
                  <?php endif; ?>


                  Then open content section of your CMS Page.



                  <div style="float: right; width: 200px;">&nbsp;
                  <p>block type="tag/popular" template="tag/popular.phtml"</p>
                  </div>
                  <div id="tabs" style="width: 680px;">
                  <ul>
                  <li><a href="#tabs-1">You text here.</a></li>
                  <li><a href="#tabs-2">You text here.</a></li>
                  <li><a href="#tabs-3">You text here.</a></li>
                  </ul>
                  <div id="tabs-1">
                  <p>You text here.</p>
                  </div>
                  <div id="tabs-2">
                  <p>You text here.</p>
                  </div>
                  <div id="tabs-3">
                  <p>You text here.</p>
                  <p>You text here.</p>
                  </div>
                  </div>


                  paste this code and this will create jquery tabs in your frontend.Hope this helps.



                  here is a reference link if you have any doubts.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 27 '14 at 7:05









                  dh47dh47

                  1,68611431




                  1,68611431












                  • thankyou this worked

                    – don7
                    Nov 27 '14 at 7:11






                  • 3





                    Adding scripts and custom tags to the head.phtml file is against Magento's best practices. The new script tags should be added via layout xml and you can add custom update handles to the about us page to target that page specifically. The script tags should be broken out into it's own javacript file as well and imported via layout xml as well.

                    – Tyler Craft
                    Jan 21 '15 at 16:20

















                  • thankyou this worked

                    – don7
                    Nov 27 '14 at 7:11






                  • 3





                    Adding scripts and custom tags to the head.phtml file is against Magento's best practices. The new script tags should be added via layout xml and you can add custom update handles to the about us page to target that page specifically. The script tags should be broken out into it's own javacript file as well and imported via layout xml as well.

                    – Tyler Craft
                    Jan 21 '15 at 16:20
















                  thankyou this worked

                  – don7
                  Nov 27 '14 at 7:11





                  thankyou this worked

                  – don7
                  Nov 27 '14 at 7:11




                  3




                  3





                  Adding scripts and custom tags to the head.phtml file is against Magento's best practices. The new script tags should be added via layout xml and you can add custom update handles to the about us page to target that page specifically. The script tags should be broken out into it's own javacript file as well and imported via layout xml as well.

                  – Tyler Craft
                  Jan 21 '15 at 16:20





                  Adding scripts and custom tags to the head.phtml file is against Magento's best practices. The new script tags should be added via layout xml and you can add custom update handles to the about us page to target that page specifically. The script tags should be broken out into it's own javacript file as well and imported via layout xml as well.

                  – Tyler Craft
                  Jan 21 '15 at 16:20













                  6














                  I wouldn't suggest to edit your head.phtml template for this. Most of the times you don't need a custom head template in your own theme because the core one is already doing its job.



                  Also personally I don't like to write code that's based on exceptions (if A then do this, if B then do this). If you need a lot of different javascripts on a lot of different pages, then your head.phtml would be filled with a lot of if statements.



                  I would suggest to add jQuery through layout XML. With CMS pages you have the ability to add extra layout XML in the admin when editing the page. Here you find an example setting a different template to the about us page. In the same way you can add jQuery to the about us page. Add this layout XML:



                  <reference name="head">
                  <action method="addItem">
                  <type>skin_js</type>
                  <script>js/jquery-1.x.x.js</script>
                  </action>
                  <block type="core/text" name="jquery.noconflict">
                  <action method="setText">
                  <text><![CDATA[<script type="text/javascript">var $j = jQuery.noConflict();</script>]]>
                  </text>
                  </action>
                  </block>
                  </reference>





                  share|improve this answer



























                    6














                    I wouldn't suggest to edit your head.phtml template for this. Most of the times you don't need a custom head template in your own theme because the core one is already doing its job.



                    Also personally I don't like to write code that's based on exceptions (if A then do this, if B then do this). If you need a lot of different javascripts on a lot of different pages, then your head.phtml would be filled with a lot of if statements.



                    I would suggest to add jQuery through layout XML. With CMS pages you have the ability to add extra layout XML in the admin when editing the page. Here you find an example setting a different template to the about us page. In the same way you can add jQuery to the about us page. Add this layout XML:



                    <reference name="head">
                    <action method="addItem">
                    <type>skin_js</type>
                    <script>js/jquery-1.x.x.js</script>
                    </action>
                    <block type="core/text" name="jquery.noconflict">
                    <action method="setText">
                    <text><![CDATA[<script type="text/javascript">var $j = jQuery.noConflict();</script>]]>
                    </text>
                    </action>
                    </block>
                    </reference>





                    share|improve this answer

























                      6












                      6








                      6







                      I wouldn't suggest to edit your head.phtml template for this. Most of the times you don't need a custom head template in your own theme because the core one is already doing its job.



                      Also personally I don't like to write code that's based on exceptions (if A then do this, if B then do this). If you need a lot of different javascripts on a lot of different pages, then your head.phtml would be filled with a lot of if statements.



                      I would suggest to add jQuery through layout XML. With CMS pages you have the ability to add extra layout XML in the admin when editing the page. Here you find an example setting a different template to the about us page. In the same way you can add jQuery to the about us page. Add this layout XML:



                      <reference name="head">
                      <action method="addItem">
                      <type>skin_js</type>
                      <script>js/jquery-1.x.x.js</script>
                      </action>
                      <block type="core/text" name="jquery.noconflict">
                      <action method="setText">
                      <text><![CDATA[<script type="text/javascript">var $j = jQuery.noConflict();</script>]]>
                      </text>
                      </action>
                      </block>
                      </reference>





                      share|improve this answer













                      I wouldn't suggest to edit your head.phtml template for this. Most of the times you don't need a custom head template in your own theme because the core one is already doing its job.



                      Also personally I don't like to write code that's based on exceptions (if A then do this, if B then do this). If you need a lot of different javascripts on a lot of different pages, then your head.phtml would be filled with a lot of if statements.



                      I would suggest to add jQuery through layout XML. With CMS pages you have the ability to add extra layout XML in the admin when editing the page. Here you find an example setting a different template to the about us page. In the same way you can add jQuery to the about us page. Add this layout XML:



                      <reference name="head">
                      <action method="addItem">
                      <type>skin_js</type>
                      <script>js/jquery-1.x.x.js</script>
                      </action>
                      <block type="core/text" name="jquery.noconflict">
                      <action method="setText">
                      <text><![CDATA[<script type="text/javascript">var $j = jQuery.noConflict();</script>]]>
                      </text>
                      </action>
                      </block>
                      </reference>






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Jan 30 '15 at 10:34









                      7ochem7ochem

                      5,86493770




                      5,86493770





















                          4














                          Or just simple copy to you theme dir, like skinfrontend[your theme]defaultjs and add this to your theme's page.xml:



                          <action method="addItem">
                          <type>skin_js</type>
                          <script>js/jquery-1.9.1.min.js</script>
                          </action>





                          share|improve this answer





























                            4














                            Or just simple copy to you theme dir, like skinfrontend[your theme]defaultjs and add this to your theme's page.xml:



                            <action method="addItem">
                            <type>skin_js</type>
                            <script>js/jquery-1.9.1.min.js</script>
                            </action>





                            share|improve this answer



























                              4












                              4








                              4







                              Or just simple copy to you theme dir, like skinfrontend[your theme]defaultjs and add this to your theme's page.xml:



                              <action method="addItem">
                              <type>skin_js</type>
                              <script>js/jquery-1.9.1.min.js</script>
                              </action>





                              share|improve this answer















                              Or just simple copy to you theme dir, like skinfrontend[your theme]defaultjs and add this to your theme's page.xml:



                              <action method="addItem">
                              <type>skin_js</type>
                              <script>js/jquery-1.9.1.min.js</script>
                              </action>






                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited Sep 30 '15 at 9:52









                              7ochem

                              5,86493770




                              5,86493770










                              answered Jan 21 '15 at 16:13









                              user956584user956584

                              1416




                              1416





















                                  3














                                  Okay I have found a way to make prototype, jQuery and bootstrap work without interfering with each other and without using jQuery.noConflict(). My layout setup (page.xml) was following(stripped for easier read):



                                  <block type="page/html_head" name="head" as="head">
                                  <action method="addJs"><script>prototype/prototype.js</script></action>
                                  <action method="addJs"><script>lib/ccard.js</script></action>
                                  <action method="addJs"><script>prototype/validation.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>varien/menu.js</script></action>
                                  <action method="addJs"><script>mage/translate.js</script></action>
                                  <action method="addJs"><script>mage/cookies.js</script></action>
                                  <action method="addJs"><script>buzzthemes/buzz-intro/jquery.min.js</script></action>
                                  <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/bootstrap.js</script></action>
                                  <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/responsive-tabs.js</script></action>
                                  <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/clickable.js</script></action>
                                  <block type="page/js_cookie" name="js_cookies" template="page/js/cookie.phtml"/>
                                  <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/site.js</script></action>
                                  </block>


                                  I was getting errors like following:




                                  TypeError: element.attachEvent is not a function



                                  element.attachEvent("on" + actualEventName, responder);



                                  TypeError: element.dispatchEvent is not a function



                                  element.dispatchEvent(event);




                                  I did not want to change $ everywhere. So, I made three javascript files as follows:




                                  proto_to_temp.js having following code:




                                  var $tempPrototypeDollar = $;



                                  after_jquery.js having following code:




                                  $ = jQuery;



                                  after_all.js having following code:




                                  $ = $tempPrototypeDollar;


                                  As you can probably guess already, the first script assigns current $ variable (owned by prototype) to a temporary variable called $tempPrototypeDollar. Second script simply assigns jQuery to $. Third script assigns the content of $tempPrototypeDollar back to $.



                                  I included these three scripts in the following order:



                                  <block type="page/html_head" name="head" as="head">
                                  <action method="addJs"><script>prototype/prototype.js</script></action>
                                  <action method="addJs"><script>lib/ccard.js</script></action>
                                  <action method="addJs"><script>prototype/validation.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>varien/menu.js</script></action>
                                  <action method="addJs"><script>mage/translate.js</script></action>
                                  <action method="addJs"><script>mage/cookies.js</script></action>
                                  <action method="addJs"><script>buzzthemes/buzz-intro/conflict/proto_to_temp.js</script></action><!-- First Script goes just before jQuery include-->
                                  <action method="addJs"><script>buzzthemes/buzz-intro/jquery.min.js</script></action>
                                  <action method="addJs"><script>buzzthemes/buzz-intro/conflict/after_jquery.js</script></action><!-- Second Script goes just after jQuery include-->
                                  <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/bootstrap.js</script></action>
                                  <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/responsive-tabs.js</script></action>
                                  <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/clickable.js</script></action>
                                  <block type="page/js_cookie" name="js_cookies" template="page/js/cookie.phtml"/>
                                  <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/site.js</script></action>
                                  <action method="addJs"><script>buzzthemes/buzz-intro/conflict/after_all.js</script></action><!-- Third Script goes after all jQuery related code has been included -->
                                  </block>


                                  This solved all the problems for me and now jquery, bootstrap and prototype, all seem to work fine.






                                  share|improve this answer



























                                    3














                                    Okay I have found a way to make prototype, jQuery and bootstrap work without interfering with each other and without using jQuery.noConflict(). My layout setup (page.xml) was following(stripped for easier read):



                                    <block type="page/html_head" name="head" as="head">
                                    <action method="addJs"><script>prototype/prototype.js</script></action>
                                    <action method="addJs"><script>lib/ccard.js</script></action>
                                    <action method="addJs"><script>prototype/validation.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>varien/menu.js</script></action>
                                    <action method="addJs"><script>mage/translate.js</script></action>
                                    <action method="addJs"><script>mage/cookies.js</script></action>
                                    <action method="addJs"><script>buzzthemes/buzz-intro/jquery.min.js</script></action>
                                    <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/bootstrap.js</script></action>
                                    <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/responsive-tabs.js</script></action>
                                    <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/clickable.js</script></action>
                                    <block type="page/js_cookie" name="js_cookies" template="page/js/cookie.phtml"/>
                                    <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/site.js</script></action>
                                    </block>


                                    I was getting errors like following:




                                    TypeError: element.attachEvent is not a function



                                    element.attachEvent("on" + actualEventName, responder);



                                    TypeError: element.dispatchEvent is not a function



                                    element.dispatchEvent(event);




                                    I did not want to change $ everywhere. So, I made three javascript files as follows:




                                    proto_to_temp.js having following code:




                                    var $tempPrototypeDollar = $;



                                    after_jquery.js having following code:




                                    $ = jQuery;



                                    after_all.js having following code:




                                    $ = $tempPrototypeDollar;


                                    As you can probably guess already, the first script assigns current $ variable (owned by prototype) to a temporary variable called $tempPrototypeDollar. Second script simply assigns jQuery to $. Third script assigns the content of $tempPrototypeDollar back to $.



                                    I included these three scripts in the following order:



                                    <block type="page/html_head" name="head" as="head">
                                    <action method="addJs"><script>prototype/prototype.js</script></action>
                                    <action method="addJs"><script>lib/ccard.js</script></action>
                                    <action method="addJs"><script>prototype/validation.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>varien/menu.js</script></action>
                                    <action method="addJs"><script>mage/translate.js</script></action>
                                    <action method="addJs"><script>mage/cookies.js</script></action>
                                    <action method="addJs"><script>buzzthemes/buzz-intro/conflict/proto_to_temp.js</script></action><!-- First Script goes just before jQuery include-->
                                    <action method="addJs"><script>buzzthemes/buzz-intro/jquery.min.js</script></action>
                                    <action method="addJs"><script>buzzthemes/buzz-intro/conflict/after_jquery.js</script></action><!-- Second Script goes just after jQuery include-->
                                    <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/bootstrap.js</script></action>
                                    <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/responsive-tabs.js</script></action>
                                    <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/clickable.js</script></action>
                                    <block type="page/js_cookie" name="js_cookies" template="page/js/cookie.phtml"/>
                                    <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/site.js</script></action>
                                    <action method="addJs"><script>buzzthemes/buzz-intro/conflict/after_all.js</script></action><!-- Third Script goes after all jQuery related code has been included -->
                                    </block>


                                    This solved all the problems for me and now jquery, bootstrap and prototype, all seem to work fine.






                                    share|improve this answer

























                                      3












                                      3








                                      3







                                      Okay I have found a way to make prototype, jQuery and bootstrap work without interfering with each other and without using jQuery.noConflict(). My layout setup (page.xml) was following(stripped for easier read):



                                      <block type="page/html_head" name="head" as="head">
                                      <action method="addJs"><script>prototype/prototype.js</script></action>
                                      <action method="addJs"><script>lib/ccard.js</script></action>
                                      <action method="addJs"><script>prototype/validation.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>varien/menu.js</script></action>
                                      <action method="addJs"><script>mage/translate.js</script></action>
                                      <action method="addJs"><script>mage/cookies.js</script></action>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/jquery.min.js</script></action>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/bootstrap.js</script></action>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/responsive-tabs.js</script></action>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/clickable.js</script></action>
                                      <block type="page/js_cookie" name="js_cookies" template="page/js/cookie.phtml"/>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/site.js</script></action>
                                      </block>


                                      I was getting errors like following:




                                      TypeError: element.attachEvent is not a function



                                      element.attachEvent("on" + actualEventName, responder);



                                      TypeError: element.dispatchEvent is not a function



                                      element.dispatchEvent(event);




                                      I did not want to change $ everywhere. So, I made three javascript files as follows:




                                      proto_to_temp.js having following code:




                                      var $tempPrototypeDollar = $;



                                      after_jquery.js having following code:




                                      $ = jQuery;



                                      after_all.js having following code:




                                      $ = $tempPrototypeDollar;


                                      As you can probably guess already, the first script assigns current $ variable (owned by prototype) to a temporary variable called $tempPrototypeDollar. Second script simply assigns jQuery to $. Third script assigns the content of $tempPrototypeDollar back to $.



                                      I included these three scripts in the following order:



                                      <block type="page/html_head" name="head" as="head">
                                      <action method="addJs"><script>prototype/prototype.js</script></action>
                                      <action method="addJs"><script>lib/ccard.js</script></action>
                                      <action method="addJs"><script>prototype/validation.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>varien/menu.js</script></action>
                                      <action method="addJs"><script>mage/translate.js</script></action>
                                      <action method="addJs"><script>mage/cookies.js</script></action>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/conflict/proto_to_temp.js</script></action><!-- First Script goes just before jQuery include-->
                                      <action method="addJs"><script>buzzthemes/buzz-intro/jquery.min.js</script></action>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/conflict/after_jquery.js</script></action><!-- Second Script goes just after jQuery include-->
                                      <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/bootstrap.js</script></action>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/responsive-tabs.js</script></action>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/clickable.js</script></action>
                                      <block type="page/js_cookie" name="js_cookies" template="page/js/cookie.phtml"/>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/site.js</script></action>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/conflict/after_all.js</script></action><!-- Third Script goes after all jQuery related code has been included -->
                                      </block>


                                      This solved all the problems for me and now jquery, bootstrap and prototype, all seem to work fine.






                                      share|improve this answer













                                      Okay I have found a way to make prototype, jQuery and bootstrap work without interfering with each other and without using jQuery.noConflict(). My layout setup (page.xml) was following(stripped for easier read):



                                      <block type="page/html_head" name="head" as="head">
                                      <action method="addJs"><script>prototype/prototype.js</script></action>
                                      <action method="addJs"><script>lib/ccard.js</script></action>
                                      <action method="addJs"><script>prototype/validation.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>varien/menu.js</script></action>
                                      <action method="addJs"><script>mage/translate.js</script></action>
                                      <action method="addJs"><script>mage/cookies.js</script></action>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/jquery.min.js</script></action>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/bootstrap.js</script></action>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/responsive-tabs.js</script></action>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/clickable.js</script></action>
                                      <block type="page/js_cookie" name="js_cookies" template="page/js/cookie.phtml"/>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/site.js</script></action>
                                      </block>


                                      I was getting errors like following:




                                      TypeError: element.attachEvent is not a function



                                      element.attachEvent("on" + actualEventName, responder);



                                      TypeError: element.dispatchEvent is not a function



                                      element.dispatchEvent(event);




                                      I did not want to change $ everywhere. So, I made three javascript files as follows:




                                      proto_to_temp.js having following code:




                                      var $tempPrototypeDollar = $;



                                      after_jquery.js having following code:




                                      $ = jQuery;



                                      after_all.js having following code:




                                      $ = $tempPrototypeDollar;


                                      As you can probably guess already, the first script assigns current $ variable (owned by prototype) to a temporary variable called $tempPrototypeDollar. Second script simply assigns jQuery to $. Third script assigns the content of $tempPrototypeDollar back to $.



                                      I included these three scripts in the following order:



                                      <block type="page/html_head" name="head" as="head">
                                      <action method="addJs"><script>prototype/prototype.js</script></action>
                                      <action method="addJs"><script>lib/ccard.js</script></action>
                                      <action method="addJs"><script>prototype/validation.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>varien/menu.js</script></action>
                                      <action method="addJs"><script>mage/translate.js</script></action>
                                      <action method="addJs"><script>mage/cookies.js</script></action>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/conflict/proto_to_temp.js</script></action><!-- First Script goes just before jQuery include-->
                                      <action method="addJs"><script>buzzthemes/buzz-intro/jquery.min.js</script></action>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/conflict/after_jquery.js</script></action><!-- Second Script goes just after jQuery include-->
                                      <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/bootstrap.js</script></action>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/responsive-tabs.js</script></action>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/clickable.js</script></action>
                                      <block type="page/js_cookie" name="js_cookies" template="page/js/cookie.phtml"/>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/bootstrap/site.js</script></action>
                                      <action method="addJs"><script>buzzthemes/buzz-intro/conflict/after_all.js</script></action><!-- Third Script goes after all jQuery related code has been included -->
                                      </block>


                                      This solved all the problems for me and now jquery, bootstrap and prototype, all seem to work fine.







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Mar 18 '16 at 13:11









                                      SugatoSugato

                                      8514




                                      8514





















                                          2














                                          Include the following in the top of the design page



                                          <script>
                                          var $j = jQuery.noConflict();
                                          </script>


                                          And use jQuery as $j instead of $(Eg:$j('.class').hide();)



                                          PS: You can use any other variable instead of j in var $j






                                          share|improve this answer





























                                            2














                                            Include the following in the top of the design page



                                            <script>
                                            var $j = jQuery.noConflict();
                                            </script>


                                            And use jQuery as $j instead of $(Eg:$j('.class').hide();)



                                            PS: You can use any other variable instead of j in var $j






                                            share|improve this answer



























                                              2












                                              2








                                              2







                                              Include the following in the top of the design page



                                              <script>
                                              var $j = jQuery.noConflict();
                                              </script>


                                              And use jQuery as $j instead of $(Eg:$j('.class').hide();)



                                              PS: You can use any other variable instead of j in var $j






                                              share|improve this answer















                                              Include the following in the top of the design page



                                              <script>
                                              var $j = jQuery.noConflict();
                                              </script>


                                              And use jQuery as $j instead of $(Eg:$j('.class').hide();)



                                              PS: You can use any other variable instead of j in var $j







                                              share|improve this answer














                                              share|improve this answer



                                              share|improve this answer








                                              edited Apr 16 at 11:59









                                              7ochem

                                              5,86493770




                                              5,86493770










                                              answered Dec 24 '16 at 7:09









                                              Jithin U. AhmedJithin U. Ahmed

                                              1668




                                              1668



























                                                  draft saved

                                                  draft discarded
















































                                                  Thanks for contributing an answer to Magento Stack Exchange!


                                                  • Please be sure to answer the question. Provide details and share your research!

                                                  But avoid


                                                  • Asking for help, clarification, or responding to other answers.

                                                  • Making statements based on opinion; back them up with references or personal experience.

                                                  To learn more, see our tips on writing great answers.




                                                  draft saved


                                                  draft discarded














                                                  StackExchange.ready(
                                                  function ()
                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f45569%2fhow-to-add-jquery-in-magento%23new-answer', 'question_page');

                                                  );

                                                  Post as a guest















                                                  Required, but never shown





















































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown

































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown







                                                  Popular posts from this blog

                                                  Bulk add to cart function issuecart vs. mini cart issue … rwd themeRedirect Add to cart button to cart pageAdd to cart issue - Magento 2.1The requested Payment Method is not available When creating an orderM2: reason add-to-cart might not function in production modeAdd to cart issue in some android devicesMagento 2 - custom price can not add to subtotal and grand total after add to cartAdd to cart codeIssue with my cart module on pdp and cart pages, just keeps spinningBulk price and quantity update using rest api

                                                  Magento2 - How to hide price filter only in specific categories?Multiselect price filter attribute in layered navigationhide only some categories from layered navigation in magentoRemove Price Filter on certain categoriescustomize layered price filter?Hide Price for a particular customer groupPrice filter in layered navigation not working correctly with price including tax in magento 2.2.3Magento 2 how to hide attribute at Layered navigation?Magento 2. how to hide price only for specific categoriesMagento 2 How can I hide the price and total from cart and checkout summary?Magento2: Can we add navigation layered filter like price filter for other attribute?