RJS, Safari, Error - DOM exception 7


#1

I’m having nasty cross-browser headache.

Not new to Rails, but quite new to AJAX/RJS.

My app works perfectly in Firefox, but generates
the error in the subject line in Safari.

Pretty simple circumstance, completely reproducible
in all cases:

Any ideas? Relevant code attached.

Layout:

<?xml version="1.0" encoding="utf-8"?> Secret Message <%= stylesheet_link_tag 'scaffold' %> <%= javascript_include_tag :defaults %>
<%= yield -%>

View:

   <div id="addresses">

<%= render :partial => ‘addresses’ -%>

<%= form_remote_tag :url => { :action => :add_recipient },
:html => { :id =>
‘add_recipient_form’ } %>

New recipient:

<%= text_field :email, :address %>

<%= submit_tag ‘Add’ %>

<%= end_form_tag %>
<%= form_remote_tag :url => { :action => :send_message },
:html => { :id => ‘message_form’ } %>

Secret Message:

<%= text_area :message, :body, :cols => 80, :rows => 20 %


       <%= submit_tag 'Send' %><br/>
     </fieldset>
   <%= end_form_tag %>
   <%= observe_field :message_body, :frequency => 2, :url =>

{ :action => :preview_message }, :with => “‘message=’ + escape
(value)” %>


<%= render :partial => ‘message’ -%>

Partial (_address.rhtml, same problem with both):

<% unless @error.nil? -%>
Error:


  • <%= h @error %>


<% end -%>
Recipients:

    <% @message.email_messages.each do |em| -%>

  • <%= h em.email.address %>
    <%= form_remote_tag :url => { :action
    => :remove_recipient, :id => em },
    :html => { :id =>
    ‘remove_recipient_form_’ + em.id.to_s } %>

    <%= submit_tag ‘Remove’ %>

    <%= end_form_tag %>

  • <% end -%>

Inline RJS:

render :update do |page|
page.hide ‘addresses’
page.replace_html ‘addresses’, :partial => ‘addresses’
page.visual_effect :blind_down, ‘addresses’, :duration => 0.5
end


– Tom M.