anchor.diff:                :frequency => wait_time,
                 :url => { :controller => 'chat',
                           :action => 'user_is_typing',
  -                        :id => @channel })
  +                        :id => @channel },
  +              :condition => 'stop_ajax_calls == false')
   %>
  +
  +<%= javascript_tag '
  +var stop_ajax_calls = false;
  +function stop_ajax(){stop_ajax_calls = true;}
  +'%>
  
positive.code:                                    :action => 'poll_channel_for_updates',
                                     :id => @channel},
                           :frequency => wait_time,
                           :complete => "eval(request.responseText)"
  #                         :update => 'userlist'
  %>
  
  
negative.code: 
  <p>
  <% form_tag(:action => :leave_channel, :id => @channel) do %>
    <input type='submit' value='<%= "Leave channel"[:leave_channel]%>' onclick='stop_ajax()' />
  <% end %>
  </p>
  
  