1

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 .

3 Answers 3

2

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.

Sign up to request clarification or add additional context in comments.

Comments

1

Refer to jQuery noConflict docs: http://api.jquery.com/jQuery.noConflict/#example-1

Use this example in you child page:

jQuery.noConflict();
(function($) {
  $(function() {
   // put your jquery code in here
  });
})(jQuery);
// other code using $ as an alias to the other library

2 Comments

Look at my question, i have used noConflict, wasn't of much help .
I think if you use a self executing function you don't need the noConflict() call.
0

If your conflicting issue not resolving even after putting noConflict script, replace all '$' symbol with 'jQuery' throughout your jquery code.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.