# Updating div on Ajax call in IE6

**URL:** <https://www.ruby-forum.com/t/updating-div-on-ajax-call-in-ie6/139016>\
**Category:** Rails\
**Created:** [May 29, 2008, 11:04pm UTC](https://www.ruby-forum.com/t/updating-div-on-ajax-call-in-ie6/139016 "2008-05-29T23:04:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![neha-rohan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/34f0e0/32.png) [@neha-rohan](https://www.ruby-forum.com/u/neha-rohan)\
**Post date:** [May 29, 2008, 11:04pm UTC](https://www.ruby-forum.com/t/updating-div-on-ajax-call-in-ie6/139016/1 "2008-05-29T23:04:14Z")

</div>

In my application when i make an ajax call i am trying to update a div  
and it works fine in mozilla but not in IE. In IE all ajax calls are  
made but the div doesn’t get updated at all  
Any clue as to why this might be happening?

My code looks something like  
\<%=form\_remote\_tag :method=\>‘post’, :url=\>{:action =\>‘choose\_action’,  
}%\>

 \<%= link\_to\_remote 'Add Additional Values', :url =\> {:action =\> 'update\_auto\_complete\_div', }%\> 

def update\_auto\_complete\_div  
render :update do |page|  
page.replace\_html “contract\_data\_element\_data\_#{params[:count]}”,  
:inline =\> “”  
page.replace\_html “contract\_data\_element\_data\_#{params[:count]}”,  
:partial=\>‘data\_string\_autocomplete’  
end  
end

---

<div class="post-metadata">

**Author:** ![neha-rohan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/34f0e0/32.png) [@neha-rohan](https://www.ruby-forum.com/u/neha-rohan)\
**Post date:** [May 30, 2008, 12:17am UTC](https://www.ruby-forum.com/t/updating-div-on-ajax-call-in-ie6/139016/2 "2008-05-30T00:17:27Z")

</div>

On 29 May 2008, at 22:04, Neha C. wrote:

> In my application when i make an ajax call i am trying to update a div  
> and it works fine in mozilla but not in IE. In IE all ajax calls are  
> made but the div doesn’t get updated at all  
> Any clue as to why this might be happening?

You’re not passing a count parameter to update\_auto\_complete\_div, so  
its going to end up trying to replace the contents of  
contract\_data\_element\_data\_ which I assume doesn’t exist (why 2  
replace\_htmls?)

Fred

---

<div class="post-metadata">

**Author:** ![neha-rohan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/34f0e0/32.png) [@neha-rohan](https://www.ruby-forum.com/u/neha-rohan)\
**Post date:** [May 30, 2008, 12:21am UTC](https://www.ruby-forum.com/t/updating-div-on-ajax-call-in-ie6/139016/3 "2008-05-30T00:21:00Z")

</div>

Frederick C. wrote:

> On 29 May 2008, at 22:04, Neha C. wrote:
> 
> > In my application when i make an ajax call i am trying to update a div  
> > and it works fine in mozilla but not in IE. In IE all ajax calls are  
> > made but the div doesn’t get updated at all  
> > Any clue as to why this might be happening?
> 
> You’re not passing a count parameter to update\_auto\_complete\_div, so  
> its going to end up trying to replace the contents of  
> contract\_data\_element\_data\_ which I assume doesn’t exist (why 2  
> replace\_htmls?)
> 
> Fred

Actually i am passing that parameter and a number of other parameters.  
Even if my code is like  
\<%=form\_remote\_tag :method=\>‘post’, :url=\>{:action =\>‘choose\_action’,  
}%\>

 \<%= link\_to\_remote 'Add Additional Values', :url =\> {:action =\> 'update\_auto\_complete\_div', }%\> 

def update\_auto\_complete\_div  
render :update do |page|  
page.replace\_html “contract\_data\_element\_data\_#{params[:count]}”,  
:inline =\> “”  
page.replace\_html “contract\_data\_element\_data\_#{params[:count]}”,  
:partial=\>‘data\_string\_autocomplete’  
end  
end

It still doesnt work in IE

---

<div class="post-metadata">

**Author:** ![neha-rohan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/34f0e0/32.png) [@neha-rohan](https://www.ruby-forum.com/u/neha-rohan)\
**Post date:** [May 30, 2008, 1:13am UTC](https://www.ruby-forum.com/t/updating-div-on-ajax-call-in-ie6/139016/4 "2008-05-30T01:13:10Z")

</div>

On 29 May 2008, at 23:21, Neha C. wrote:

> > >
> 
> }%\>
> 
> \<%= link\_to\_remote 'Add Additional Values', :url =\> {:action =\> 'update\_auto\_complete\_div', }%\>

You’d have to set the div id to contract\_data\_element\_data\_  
If that code is what’s in your view (and if not then asking people to  
help diagnose a problem with 1 piece of code while showing another)  
then you’re really not passing any parameters to  
update\_auto\_complete\_div. IE6 is weird though.

Fred

---

<div class="post-metadata">

**Author:** ![neha-rohan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/34f0e0/32.png) [@neha-rohan](https://www.ruby-forum.com/u/neha-rohan)\
**Post date:** [May 30, 2008, 1:17am UTC](https://www.ruby-forum.com/t/updating-div-on-ajax-call-in-ie6/139016/5 "2008-05-30T01:17:21Z")

</div>

Frederick C. wrote:

> On 29 May 2008, at 23:21, Neha C. wrote:
> 
> > > >
> > 
> > }%\>
> > 
> > \<%= link\_to\_remote 'Add Additional Values', :url =\> {:action =\> 'update\_auto\_complete\_div', }%\>
> 
> You’d have to set the div id to contract\_data\_element\_data\_  
> If that code is what’s in your view (and if not then asking people to  
> help diagnose a problem with 1 piece of code while showing another)  
> then you’re really not passing any parameters to  
> update\_auto\_complete\_div. IE6 is weird though.
> 
> Fred

In my code i open a popup window and when i create that window for the  
first time it works fine in IE also…but then when i open another  
window that has code to edit those values it stops working.
