Jquery Conflict with prototype

Hello,

I have a problem with a conflict with my script between jquery and prototype.

At the beginning of my script, i use this library
<script src="/SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<script src="/ScriptLibrary/jquery-latest.pack.js" type="text/javascript"></script>
<script src="/ScriptLibrary/jquery.autocomplete.js" type="text/javascript"></script>
<script src="/ScriptLibrary/jquery.bgiframe.min.js" type="text/javascript"></script>
<script src="/lib/prototype.js" type="text/javascript"></script>
<script src="/src/scriptaculous.js" type="text/javascript"></script>
<script src="/js/ajax.js" type="text/javascript"></script>
<script src='/js/jquery/jquery.2.js' ></script>

I use ajax too :

jQuery.ajax({
            url: '/test/test.php',
            type: 'POST',
            dataType: 'json',
            data: 'pRev=' + Rct,
            success: function(response)
});

After, i use parseJSON and i have a problem.

The error is : Object function (a,b){return new D.fn.init(a,b)} has no method 'parseJSON'

Here my code : jQuery.parseJSON(response)

Thanks for help.
bruno_boccaraAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris StanyonWebDevCommented:
At the top of your script you need to call the jQuery noConflict() function:

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

Open in new window

If you need jQuery outside of that then you must use jQuery in place of all $
0
bruno_boccaraAuthor Commented:
I do this but its not work. i do jQuery.noConflict();

but why you do Jquery(document).ready(function($)
{
   
});

if i do just Jquery. for all its not good ?
0
Chris StanyonWebDevCommented:
Calling the noConflict() hands back the $ to other libraries. The reason I put that code is that even with other libraries you can use the $ for jQuery inside that block.

If you're still getting problems, maybe post a link to your site so we can have a proper look. Impossible to tell from the snippet you've posted. You say you get an error with parseJSON, but your code doesn't show that call at all.

Also check the scripts you're loading - it looks like you might be loading 2 versions of jQuery - jquery-latest.pack.js and jquery.2.js
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bruno_boccaraAuthor Commented:
The problem was because we called twice the jquery library !

Thanks a lot
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.