Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok, Prototype is a javascript framework similar to jQuery in respect to the fact that it handles most of the ajax, dom manipulation etc and generally just making working with javascript much more simple and concise - eliminating a lot of cross browser issues with little effort.</p> <p>Script.aculo.us is being used for the interface side, i.e. all the nice loaders, sliders, drag and drop in the admin section etc. This is all being handled with script.aculo.us.</p> <p>Sure jQuery can probably handle this but cannot simple replace Magentos use of Prototype and Scriptaculous with jQuery. Good luck to you if you try.</p> <p>Magento uses javascript very heavily (too heavily) and there are tons of inline javascript throughout the entire site.</p> <p>What you can do though is accept that all of this javascript is in place for you to use. If you want to add new functionality to the site then you are free to use jQuery but dont try to undo what has been done in another library / framework.</p> <p>If you must use jQuery then all you need do is add the following line to your page.xml layout file:</p> <pre><code>&lt;action method="addJs"&gt;&lt;script&gt;path to your jquery&lt;/script&gt;&lt;/action&gt; </code></pre> <p>its around line 38 and can be found in the default section and so affects almost every page.</p> <p>and then obviously the same again for any of your own javascript files you create.</p> <p>With regards to the inline javascript that magento is producing, a lot of it is based on onclick events and the lieks so you use jQuery to remove those events with syntax similar to the following:</p> <pre><code>$('.el').removeAttr('onclick'); </code></pre> <p>for example, if you want to remove the javascript from the add to cart button you would use:</p> <pre><code>$('.btn-cart').removeAttr('onclick'); </code></pre> <p>and then bind your own events to that button.</p> <p>As alway.removeAttr('onclick');</p> <p>Hope this helps.</p> <p>Drew</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload