How to avoid conflict between JQuery and Prototype or other JavaScript library

If a page has both JQuery and Prototype then I got conflict. There is a option to disable $ sign for JQuery so there is no conflict. I have used jq keyword for JQuery instead of $.

<script type="text/javascript" src="js/jquery-1.4.2.js"></script>

var jq = jQuery.noConflict();

Thats it

    • arun
    • June 16th, 2011

    when i use jq instead of $ jquery is not working!!!!

      • Md. Ruzdi Islam
      • September 3rd, 2011

      because it takes the execution with jq instead of $ which is also used in prototype.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: