On 18 March 2010 15:33, Salil Gaikwad <[email protected]> wrote: > Hi All, > > I got RJS error: TypeError: element is null while using ajax. > > I used in view > > <%= periodically_call_remote(:url=>{:action=>'get_user_list', :id=>'1'}, > :frequency => '5') %> > > in controller > > render :update do |page| > page.replace_html 'chat_area', :partial => 'chat_area', :object > => [...@chats, @user] if @js_update > end
I believe this is expecting to find a div with id chat_area to replace. I do not see this div in the code below, though I may be just not be seeing it. Colin > > in partial chat_area > > <% if [email protected]? && !show_div(@chats).blank?%> > <% show_div_id=show_div(@chats) %> > <% for chat in @chats %> > <div class="popup" id="chat_area_<%= chat.id %>" > style="display:<%= (chat.id == show_div_id)? 'block' : 'none' %>;"> > > <% form_remote_for(:chat, :url => {:controller=>'chats', > :action=>'create', :id=>1}, :html=>{:name => "form_#{chat.id}"}, > :complete=>"resetContent('#{chat.id}');") do |f| %> > <div style="display:none;"> > <%= f.hidden_field :sessionNo, :value=>chat.sessionNo %> > <%= f.text_area :chatContent, :id=> > "chatContent_field_#{chat.id}", :cols=>"100", :rows=>"6", > :onKeyPress=>"return submitenter(this,event);" %> > </div> > <input type="image" src="images/chat/send-hover.png" > value="Send" onclick="return submit_button('<%= chat.id %>')"/> > <% end %> > </div> > > </div> > <% end %> > > <% else %> > <div class="popup" id="chat_area_none" style="display:'block';"> > <input type="image" disabled ="disabled" > src="images/chat/send.png" style="cursor:default;" value="Send" /> > </div> > <% end %> > > > > Any help is appreciated. > > > Regards, > > Salil Gaikwad > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

