I want to use JQuery in magento. When I included JQuery in the code, Prototype is throwing errors at this line.

element.attachEvent("ondataavailable", responder);

Can anyone help me?


1 Answer 1


This error is causing because Jquery and Prototype is getting conflict.You need to solve this conflict.

1) Create one js file called noConflict.js with the following content.

var jQuery = $.noConflict();

and include this file after your jquery.js

2) And you can use this jquery wih the following code

<script type="text/javascript">
        // your code    

P.S. for more information on solving jquery conflict refer http://magento-online-tutorials.blogspot.in/2015/10/how-to-solve-jquery-and-prototype.html

  • instead of creating a new file can't I add the $.noConflict(); in my code directly
    – Strikers
    Commented Mar 12, 2015 at 7:13
  • yes u can add.... Commented Mar 12, 2015 at 7:23

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