if($("#reply_message_<%= @memo.id%>").length > 0) { $("#reply_message_<%= @memo.id%>").replaceWith("<%= escape_javascript(render :partial => 'memos/reply_message', :locals => {:reply => @memo}) %>"); }else if($("#reply_to_message_<%= @memo.id%>").length >0) { $("#reply_to_message_<%= @memo.id%>").replaceWith("
"); }