Forum: Ruby on Rails RJS, Safari, Error - DOM exception 7

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Tom M. (Guest)
on 2006-05-13 00:09
(Received via mailing list)
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"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
   <head>
     <title>Secret Message</title>
     <%= stylesheet_link_tag 'scaffold' %>
     <%= javascript_include_tag :defaults %>
   </head>
   <body>
     <div id="main">
<%= yield -%>
     </div>
   </body>
</html>

View:
-----
       <div id="addresses">
<%= render :partial => 'addresses' -%>
       </div>
       <%= form_remote_tag :url     => { :action => :add_recipient },
                           :html    => { :id     =>
'add_recipient_form' } %>
         <fieldset>
           <span class="label">New recipient:</span><br/>
           <%= text_field :email, :address %><br/>
           <%= submit_tag 'Add' %>
         </fieldset>
       <%= end_form_tag %>
       <%= form_remote_tag :url     => { :action => :send_message },
                           :html    => { :id     => 'message_form' } %>
         <fieldset>
           <span class="label">Secret Message:</span><br/>
           <%= text_area :message, :body, :cols => 80, :rows => 20 %
 ><br/>
           <%= submit_tag 'Send' %><br/>
         </fieldset>
       <%= end_form_tag %>
       <%= observe_field :message_body, :frequency => 2, :url =>
{ :action => :preview_message }, :with => "'message=' + escape
(value)" %>
       <div id="message">
<%= render :partial => 'message' -%>
       </div>

Partial (_address.rhtml, same problem with both):
--------
<% unless @error.nil? -%>
         <span class="label">Error:</span>
         <ul id="error">
           <li><%= h @error %></li>
         </ul>
<% end -%>
         <span class="label">Recipients:</span>
         <ul id="recipients">
<% @message.email_messages.each do |em| -%>
           <li>
             <%= h em.email.address %>
             <%= form_remote_tag :url => { :action
=> :remove_recipient, :id => em },
                                           :html   => { :id     =>
'remove_recipient_form_' + em.id.to_s } %>
               <fieldset>
                 <%= submit_tag 'Remove' %>
               </fieldset>
             <%= end_form_tag %>
           </li>
<% end -%>
         </ul>

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.
This topic is locked and can not be replied to.