3

This question already has an answer here:

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?

marked as duplicate by Keyul Shah, Marius Mar 12 '15 at 7:13

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

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">
    jQuery(document).ready(function(){
        // your code    
    });
</script>

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 Mar 12 '15 at 7:13
  • yes u can add.... – Pradeep Sanku Mar 12 '15 at 7:23

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