title: Magento Javascript merge - why does it break in some cases?
body: <p>Okay I've been doing JS merges for some time now and still can't figure out the logic behind making a successful merge. It comes down to repositioning libraries upwards and downwars on merge list. Sometimes jquery must be on top, sometimes it doesn't. Sometimes fancybox needs to be added as addJs, sometimes as addItem. </p>
  
  <p>So, what is in your experience causing JS libraries to break when you use Magento's merge JS? Are there any rules for sucessful merge?</p>
  
  <p>UPDATE: Just now in my local.xml I moved from</p>
  
  <pre><code>&lt;action method="addItem"&gt;&lt;type&gt;skin_js&lt;/type&gt;&lt;name&gt;js/magiczoomplus.js&lt;/name&gt;&lt;/action&gt;
  </code></pre>
  
  <p>to </p>
  
  <pre><code>&lt;action method="addJs"&gt;&lt;script&gt;jquery/magiczoomplus.js&lt;/script&gt;&lt;/action&gt;
  </code></pre>
  
  <p>and that solved the magiczoomplus error I was getting on the page. How so?</p>
  
  <p>I'm trying to understand this problem so I can better tackle it in the future</p>