# Ajax search feature works in FF but not IE

**URL:** <https://www.ruby-forum.com/t/ajax-search-feature-works-in-ff-but-not-ie/158796>\
**Category:** Rails\
**Created:** [January 28, 2009, 2:16am UTC](https://www.ruby-forum.com/t/ajax-search-feature-works-in-ff-but-not-ie/158796 "2009-01-28T02:16:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpardee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e47c2d/32.png) [@rpardee](https://www.ruby-forum.com/u/rpardee)\
**Post date:** [January 28, 2009, 2:16am UTC](https://www.ruby-forum.com/t/ajax-search-feature-works-in-ff-but-not-ie/158796/1 "2009-01-28T02:16:45Z")

</div>

Hey All,

I put a simple search box on my projects/index view, via the following  
observe\_field call:

\<%= observe\_field(‘project\_search’,  
:url =\> { :controller =\> “projects”, :action =\> “index\_search”},  
:update =\> “project-list”,  
:loading =\> “Element.show(‘search\_spinner’)”,  
:complete =\> “Element.hide(‘search\_spinner’)”,  
:frequency =\> 1,  
:submit =\> ‘search’) -%\>

The index\_search action queries out the proper set of projects & renders  
the list to a partial, like so:

def index\_search  
min\_query\_length = 1  
q = params[:project\_search]

if q.length \> min\_query\_length then  
@projects = Project.find\_by\_name\_fragment(q) || []  
else  
order\_by = params[:order\_by] || ‘statuses.name’  
@projects = Project.find(:all, :order =\> order\_by, :include =\>  
‘status’)  
end  
respond\_to do |format|  
format.js do  
render :partial =\> “project\_list.html.erb”  
end  
end  
end

That partial renders a table w/one row per project. This works just  
fine from FireFox. But from IE I don’t get my table–just a blank page.  
So the records that used to be in my table id=“project-list” are gone,  
but I don’t see the new ones that index\_search queried out of the db.  
Judging from the log, IE is indeed making the request to index\_search,  
passing the params it should, etc. The log even says, e.g.,

Rendered projects/\_project (0.01600)  
Rendered projects/\_project\_list.html.erb (0.10900)

But IE doesn’t seem to want to actually _display_ these guys. FF’s web  
development toolbar tells me I’m in “standards compliance mode” when I  
pull up a searched list of projects, so I believe the markup is all  
kosher.

What am I doing wrong?

Thanks!

-Roy

Roy P.  
Research Analyst/Programmer  
Group Health Center For Health Studies (Cancer Research Network)  
(206) 287-2078  
Google Talk: rpardee

---

<div class="post-metadata">

**Author:** ![rpardee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e47c2d/32.png) [@rpardee](https://www.ruby-forum.com/u/rpardee)\
**Post date:** [January 28, 2009, 3:07am UTC](https://www.ruby-forum.com/t/ajax-search-feature-works-in-ff-but-not-ie/158796/2 "2009-01-28T03:07:39Z")

</div>

Pardee, Roy wrote:

> \<%= observe\_field(‘project\_search’,  
> :url =\> { :controller =\> “projects”, :action =\> “index\_search”},  
> :update =\> “project-list”,  
> …  
> That partial renders a table w/one row per project. This works just fine from FireFox. But from IE I don’t get my table–just a blank page. So the records that used to be in my table id=“project-list” are gone, but I don’t see the new ones that index\_search queried out of the db. Judging from the log, IE is indeed making the request to index\_search, passing the params it should, etc. The log even says, e.g.,  
> …  
> But IE doesn’t seem to want to actually _display_ these guys. FF’s web development toolbar tells me I’m in “standards compliance mode” when I pull up a searched list of projects, so I believe the markup is all kosher.

:update changes the innerHTML of a node, so you will be inserting  
the table inside the table tag.

Wrap a div around the table and update that instead.

–  
Rails Wheels - Find Plugins, List & Sell Plugins -  
[http://railswheels.com](http://railswheels.com)

---

<div class="post-metadata">

**Author:** ![rpardee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e47c2d/32.png) [@rpardee](https://www.ruby-forum.com/u/rpardee)\
**Post date:** [January 28, 2009, 5:22pm UTC](https://www.ruby-forum.com/t/ajax-search-feature-works-in-ff-but-not-ie/158796/3 "2009-01-28T17:22:39Z")

</div>

Fantastic! That did the trick. Thanks!
