Search code examples
javascriptjqueryprototypejsconflict

Prototype.js conflicting with jquery.js : How to solve this?


I have parent.jsp, which contains prototype.js. The parent.jsp contains a link , which loads contents from child.jsp, but the child.jsp contains jquery.js. Now prototype is conflicting with jquery and i get a whole lot of errors in internet explorer and one error in mozilla firefox.

Most of internet explorer problems are referring to $ symbol and document.body.appendChild().

The mozilla firefox is giving this error:

typeerror value does not implement interface node in this line of prototype :

var query= document.evaluate(expression, $(parentElement) || document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);

Can any one suggest how to solve this problem ? I have googled a lot, given noConflict for jquery, still nothing is working .


Solution

  • Okay so , i found out the problem, it seems all this problem was because of jquery.js getting loaded twice, once from child.jsp and again from another page. Hut!!!.

    That was horrible, took me forever to find that out.