# JQuery Ajax problem=Weird- works once stops next

**URL:** <https://www.ruby-forum.com/t/jquery-ajax-problem-weird-works-once-stops-next/166372>\
**Category:** Rails\
**Created:** [April 24, 2009, 1:29pm UTC](https://www.ruby-forum.com/t/jquery-ajax-problem-weird-works-once-stops-next/166372 "2009-04-24T13:29:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![preethi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f04885/32.png) [@preethi](https://www.ruby-forum.com/u/preethi)\
**Post date:** [April 24, 2009, 1:29pm UTC](https://www.ruby-forum.com/t/jquery-ajax-problem-weird-works-once-stops-next/166372/1 "2009-04-24T13:29:16Z")

</div>

Hi,  
I’m facing a weird problem with jquery and ajax calls.

I’ve a page which has a search box and also a listin which says “join”.

Search uses Ajax calls.  
Join uses jquery call which opens a thickbox.

for the first time when page is loaded, thickbox works perfectly.  
But after i do search and then with the searched results if i do “join”,  
thick box stops working.

I’ve added thickbox.js  
then jQuery.noConflict()  
and then prototype.js

I find this order to be perfect to avoid any conflicts.

Is there any thing am missing?  
Can anyone help?  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![preethi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f04885/32.png) [@preethi](https://www.ruby-forum.com/u/preethi)\
**Post date:** [April 24, 2009, 3:15pm UTC](https://www.ruby-forum.com/t/jquery-ajax-problem-weird-works-once-stops-next/166372/2 "2009-04-24T15:15:56Z")

</div>

Preethi S. wrote:

> Hi,  
> I’m facing a weird problem with jquery and ajax calls.
> 
> I’ve a page which has a search box and also a listin which says “join”.
> 
> Search uses Ajax calls.  
> Join uses jquery call which opens a thickbox.
> 
> for the first time when page is loaded, thickbox works perfectly.  
> But after i do search and then with the searched results if i do “join”,  
> thick box stops working.
> 
> I’ve added thickbox.js  
> then jQuery.noConflict()  
> and then prototype.js
> 
> I find this order to be perfect to avoid any conflicts.
> 
> Is there any thing am missing?  
> Can anyone help?  
> Thanks in advance.

Added by me:  
I proceeded one step further and found the reason of this problem.  
The reason is  
I’m doing page.replace\_html to place my listing where i’m having the  
“join” button.

My thickbox.js is having a document.ready ready function which prepares  
are the places where thick box has to be applied.  
When i do search, document.ready is not called. So links are not  
identified.Thats why.

Now i found the problem but i dont know how to solve it.  
I’ve added  
\<%= javascript\_include\_tag ‘thickbox.js’%\>  
in my partial also. Still it is not calling the ready function eveytime  
i do search.  
HOw to solve it? does anyone have a solution.  
Thanks
