Dear all After I search something, it can successfully display the result in the browser. However, I view the Page source and found that the HTML code between the ''event_list'' div tag is not updated , the content is same as before searching....It is so strange. This problem happen in both IE and firefox... Any idea? Thank you very much. Valentino Source code for reference. View <% form_remote_tag :html => {:action => "index", :id => ''event_form''}, :update => ''event_list'', :before => "$(''spinner'').show();$(''event_list'').hide()", :success => "$(''spinner'').hide();$(''event_list'').show()" do %> ....... <%= submit_tag "Search" %> <% end %> <div id="event_list"> <%= render :partial => ''event_list'' %> </div> Controller def index ......... if request.xml_http_request? respond_to do |format| format.html {render :partial => "event_list"} end end end -- Posted via http://www.ruby-forum.com/.
On Jun 29, 7:29 am, Valentino Lun <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Dear all > > After I search something, it can successfully display the result in the > browser. However, I view the Page source and found that the HTML code > between the ''event_list'' div tag is not updated , the content is same as > before searching....It is so strange. This problem happen in both IE and > firefox... >I think browsers are just lazy about updating the page source. If the changes you''ve made actually display then i wouldn''t worry about it Fred> Any idea? > > Thank you very much. > > Valentino > > Source code for reference. > View > <% form_remote_tag :html => {:action => "index", :id => ''event_form''}, > :update => ''event_list'', :before => > "$(''spinner'').show();$(''event_list'').hide()", :success => > "$(''spinner'').hide();$(''event_list'').show()" do %> > > ....... > > <%= submit_tag "Search" %> > > <% end %> > > <div id="event_list"> > <%= render :partial => ''event_list'' %> > </div> > > Controller > def index > > ......... > > if request.xml_http_request? > respond_to do |format| > format.html {render :partial => "event_list"} > end > end > end > -- > Posted viahttp://www.ruby-forum.com/.
If you install the firebug extension for firefox there is an option to view the "generated source". Cheers, Nicholas On Jun 29, 8:14 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jun 29, 7:29 am, Valentino Lun <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote:> Dear all > > > After I search something, it can successfully display the result in the > > browser. However, I view the Page source and found that the HTML code > > between the ''event_list'' div tag is not updated , the content is same as > > before searching....It is so strange. This problem happen in both IE and > > firefox... > > I think browsers are just lazy about updating the page source. If the > changes you''ve made actually display then i wouldn''t worry about it > > Fred > > > > > Any idea? > > > Thank you very much. > > > Valentino > > > Source code for reference. > > View > > <% form_remote_tag :html => {:action => "index", :id => ''event_form''}, > > :update => ''event_list'', :before => > > "$(''spinner'').show();$(''event_list'').hide()", :success => > > "$(''spinner'').hide();$(''event_list'').show()" do %> > > > ....... > > > <%= submit_tag "Search" %> > > > <% end %> > > > <div id="event_list"> > > <%= render :partial => ''event_list'' %> > > </div> > > > Controller > > def index > > > ......... > > > if request.xml_http_request? > > respond_to do |format| > > format.html {render :partial => "event_list"} > > end > > end > > end > > -- > > Posted viahttp://www.ruby-forum.com/.
Some browsers reload the page when viewing the source code. So you wont see any changes done by ajax callbacks. 2009/6/29, Nicholas Henry <nicholas.henry-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > If you install the firebug extension for firefox there is an option to > view the "generated source". > > Cheers, > Nicholas > > > On Jun 29, 8:14 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> On Jun 29, 7:29 am, Valentino Lun <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> >> wrote:> Dear all >> >> > After I search something, it can successfully display the result in the >> > browser. However, I view the Page source and found that the HTML code >> > between the ''event_list'' div tag is not updated , the content is same as >> > before searching....It is so strange. This problem happen in both IE and >> > firefox... >> >> I think browsers are just lazy about updating the page source. If the >> changes you''ve made actually display then i wouldn''t worry about it >> >> Fred >> >> >> >> > Any idea? >> >> > Thank you very much. >> >> > Valentino >> >> > Source code for reference. >> > View >> > <% form_remote_tag :html => {:action => "index", :id => ''event_form''}, >> > :update => ''event_list'', :before => >> > "$(''spinner'').show();$(''event_list'').hide()", :success => >> > "$(''spinner'').hide();$(''event_list'').show()" do %> >> >> > ....... >> >> > <%= submit_tag "Search" %> >> >> > <% end %> >> >> > <div id="event_list"> >> > <%= render :partial => ''event_list'' %> >> > </div> >> >> > Controller >> > def index >> >> > ......... >> >> > if request.xml_http_request? >> > respond_to do |format| >> > format.html {render :partial => "event_list"} >> > end >> > end >> > end >> > -- >> > Posted viahttp://www.ruby-forum.com/. > > >-- Von meinen Mobilgerät aus gesendet