0

Possible Duplicate:
jQuery & Prototype Conflict

I think I have a problem between jQuery and prototype the problem only shows in Internet Explorer 8

http://www.urbanclothing.dk/faq/

In IE8 the browser will not expand the faq questions. Can anybody tell me how to solve it?

I'm using the IEtester to test the website with IE8.

Looking forward to get some suggestions.

Community
  • 1
  • 1

2 Answers2

0

You need to use

var j = jQuery.noConflict();

Before you load the prototype library

<script type="text/javascript" src="http://www.urbanclothing.dk/js/mw_js/jquery.js"></script>

<script type="text/javascript" charset="utf-8"> 
    var j = jQuery.noConflict();
</script>

<script type="text/javascript" src="http://www.urbanclothing.dk/js/prototype/prototype.js"></script>
Jeff Wilbert
  • 4,400
  • 1
  • 20
  • 35
  • Okay so I just need to reorder my javascripts? Because I can see I do have the " var = jQuery.." – Jens Bredal Mikkelsen Nov 18 '11 at 18:39
  • Correct, `noConflict()` doesn't work right when you call it after both jQuery and Prototype have both loaded on the page, you need to load jQuery first, then call `noConflict()`, and finally load prototype. – Jeff Wilbert Nov 18 '11 at 19:23
0

If you use the $.noConflict you can use multiple libraries

Example

$.noConflict();
jQuery(document).ready(function($) {
  // Code that uses jQuery's $ can follow here.
});
// Code that uses other library's $ can follow here.

More info can be found on: http://api.jquery.com/jQuery.noConflict/

The $.noConflict() also returns a jQuery object that can be used for jQuery only, or just use jQuery("") instead of $()

Niels
  • 48,601
  • 4
  • 62
  • 81