# How to resolve JavaScripts Conflict

**URL:** <https://www.ruby-forum.com/t/how-to-resolve-javascripts-conflict/161325>\
**Category:** Rails\
**Created:** [February 25, 2009, 2:57pm UTC](https://www.ruby-forum.com/t/how-to-resolve-javascripts-conflict/161325 "2009-02-25T14:57:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![salil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@salil](https://www.ruby-forum.com/u/salil)\
**Post date:** [February 25, 2009, 2:57pm UTC](https://www.ruby-forum.com/t/how-to-resolve-javascripts-conflict/161325/1 "2009-02-25T14:57:53Z")

</div>

How to resolve the javascripts conflicts between jQuery.js and  
prototype.js.

Thanks  
Salil

---

<div class="post-metadata">

**Author:** ![salil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@salil](https://www.ruby-forum.com/u/salil)\
**Post date:** [February 25, 2009, 3:27pm UTC](https://www.ruby-forum.com/t/how-to-resolve-javascripts-conflict/161325/2 "2009-02-25T15:27:11Z")

</div>

> **[LMGTFY - Let Me Google That For You](https://lmgtfy.app/?q=jquery%2Bwith%2Bprototype)**
>
> For all those people who find it more convenient to bother you with their question rather than to Google it for themselves.

On Wed, Feb 25, 2009 at 8:57 AM, Salil G.

---

<div class="post-metadata">

**Author:** ![salil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@salil](https://www.ruby-forum.com/u/salil)\
**Post date:** [February 25, 2009, 3:27pm UTC](https://www.ruby-forum.com/t/how-to-resolve-javascripts-conflict/161325/3 "2009-02-25T15:27:48Z")

</div>

On Wed, Feb 25, 2009 at 5:57 AM, Salil G. \<  
removed\_email\_address@domain.invalid\> wrote:

> How to resolve the javascripts conflicts between jQuery.js and  
> prototype.js.

Hi, what conflict you’re having in regards to jQuery and prototype?  
I’m  
guess that you’re talking  
about the use of $(…). Here’s a good post on a blog:

[http://disjointthoughts.com/2007/08/17/getting-thickbox-jquery-and-prototype-to-play-together-nicely/](http://disjointthoughts.com/2007/08/17/getting-thickbox-jquery-and-prototype-to-play-together-nicely/)

Good luck,

-Conrad

---

<div class="post-metadata">

**Author:** ![salil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@salil](https://www.ruby-forum.com/u/salil)\
**Post date:** [February 25, 2009, 4:10pm UTC](https://www.ruby-forum.com/t/how-to-resolve-javascripts-conflict/161325/4 "2009-02-25T16:10:47Z")

</div>

Thanx 2 both of u for a quick reply.  
My problem is if Both libraries included then only first library works.  
i.e. if i include prototype.js then jQuery.js then only prototype.js  
works.  
on change select list and toggle box which used jQuery.js doesn’t work.

Conrad T. wrote:

> On Wed, Feb 25, 2009 at 5:57 AM, Salil G. \<  
> removed\_email\_address@domain.invalid\> wrote:
> 
> > How to resolve the javascripts conflicts between jQuery.js and  
> > prototype.js.
> 
> Hi, what conflict you’re having in regards to jQuery and prototype?  
> I’m  
> guess that you’re talking  
> about the use of $(…). Here’s a good post on a blog:
> 
> [http://disjointthoughts.com/2007/08/17/getting-thickbox-jquery-and-prototype-to-play-together-nicely/](http://disjointthoughts.com/2007/08/17/getting-thickbox-jquery-and-prototype-to-play-together-nicely/)
> 
> Good luck,
> 
> -Conrad

---

<div class="post-metadata">

**Author:** ![salil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@salil](https://www.ruby-forum.com/u/salil)\
**Post date:** [February 25, 2009, 4:16pm UTC](https://www.ruby-forum.com/t/how-to-resolve-javascripts-conflict/161325/5 "2009-02-25T16:16:18Z")

</div>

i am using…

Prototype JavaScript framework, version 1.6.0.1

jQuery 1.2.3 - New Wave Javascript

rails-2.0.2

---

<div class="post-metadata">

**Author:** ![salil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@salil](https://www.ruby-forum.com/u/salil)\
**Post date:** [February 25, 2009, 4:31pm UTC](https://www.ruby-forum.com/t/how-to-resolve-javascripts-conflict/161325/6 "2009-02-25T16:31:58Z")

</div>

I will include jquery first, than include prototype:

 \<%= javascript\_include\_tag "jquery" %\> \<%= javascript\_include\_tag "prototype" %\>

or You can write jQuery code by this way:

On Wed, Feb 25, 2009 at 11:16 PM, Salil G. \<  
removed\_email\_address@domain.invalid\> wrote:

> >

–  
TWRUG Blog:  
[http://blog.rubyonrails.org.tw](http://blog.rubyonrails.org.tw)

CFC on Rails:

> **[CFC on Rails](http://zusocfc.blogspot.com)**
>
> 火車請別撞我

Only two surfaces of a box:  
[http://blog.pixnet.net/zusocfc](http://blog.pixnet.net/zusocfc)
