Topic: AJX works in IE, not in Firefox

Weird problems! I am having multiple problems with the following code.

1. form_remote_tag works in both browsers. However field level AJAX (observe_field) works in IE, but never completes (i.e. spinner keep spinning and data not updated) in Firefox.

2. When I View Source in either browser, I do not see fetched values displayed in the target DIV even though the data is displayed on the screen.

3. I am using CSS to display alternate table rows in different color. This is working in IE but not in Firefox.

Any insight would be greatly apprecaited.

-----------------View:
<%= form_remote_tag :update=>'table', :url=>{:action=>:list_professions} %>
<label for="field_id">enter Field Id  : </label>
<%= render(:partial=>"fields") -%>
<%= submit_tag "Search!", :class => "submit" %>
</form>

<form name="locator" action="" style="display:inline;">
<label for="item_name">Filter: </label>
<%= text_field_tag("query", @params['query'], :size => 10 ) %>
</form>

<%= image_tag("spinner.gif",
              :align => "absmiddle",
              :border => 0,
              :id => "spinner",
              :style =>"display: none;" ) %>

<%= observe_field "query",  :frequency => 1,
         :update => 'table',
         :before => "Element.show('spinner')",
         :success => "Element.hide('spinner')",
         :url => {:action => 'list_professions'},
         :with => "'query=' + escape($('query').value) + '&field_id=' + escape($('field_id').value)"  %>

<div id="table">
</div>

-----------------Partial:
<% if @total == 0 %>

<p>No items found...</p>

<% else %>

<p>Number of items found : <b><%= @total %></b></p>

<p>
<% if @pages.page_count > 1 %>
Page&nbsp;:
<%= pagination_links_remote @pages %>
<% end %>
</p>

<table class="grid" cellspacing="0">
    <caption>Professions</caption>
    <tr class="header">
      <td <%= sort_td_class_helper "name" %>>
        <%= sort_link_helper "Name", "name" %>
      </td>
      <td <%= sort_td_class_helper "wiki" %>>
        <%= sort_link_helper "wiki", "wiki" %>
      </td>
      <td <%= sort_td_class_helper "demand" %>>
        <%= sort_link_helper "Demand", "demand" %>
      </td>
    </tr>
    <% @professions.each do |i| %>
    <tr class="<%= cycle('reg','alt') %>">
      <td><%= i.name %></td>
      <td><%= i.wiki %></td>
      <td><%= i.demand %></td>
    </tr>
    <% end %>
</table>

<% end %>


-----------------Controller:
  def list_professions
    if not @params[:field_id].nil?
      field_id = @params[:field_id]
      sort = case @params['sort']
             when "name"  then "name ASC"
             when "wiki"   then "wiki ASC"
             when "demand" then "demand ASC"
             when "name_reverse"  then "name DESC"
             when "wiki_reverse"   then "wiki DESC"
             when "demand_reverse" then "demand DESC"
             else "name ASC"    # default if no order specified
      end

      conditions = "field_id=#{field_id}"
      if not @params[:query].nil?
        conditions = conditions + " AND name like '" + @params[:query] + "%'"
      end
     
      @total = Profession.count(:conditions => conditions)
     
      @pages, @professions = paginate(:professions,
                            :conditions => conditions,
                            :order => sort,
                            :per_page => RECORDS_PER_PAGE)
 
      #if request.xml_http_request?
        render :partial => "professions_list", :layout => false
      #end
    end
  end