I''m having a bit of problem with my remote responses ... I''ve got this link: <%= link_to_remote(_("_add"), :url => {:controller => ''versions'', :action => ''new'', :project => @project, :id => @document}, :loading => "Element.show(''loader'')", :complete => evaluate_remote_response) %> <div id = "version_form" class="form" style="display: none"> </div> which calls this rjs file: page[''version_form''].replace_html :partial => "new" page.visual_effect :slide_down, :version_form, :duration => 0.2 page[''loader''].hide where the partial, ''new'' is a form. This works fine in safari and firefox but I just can''t get it working in ie (6&7). I''ve even tried commenting out the first 2 lines of the rjs file so that it reads: page[''loader''].hide and nothing else but nope. My loader just stays on. Any ideas? Oh and Happy New Year by the way! Regards Adam -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Some additional info: For some reason, the above works in IE 6 & 7 when I replace the .rjs with an inline rjs in the controller action. And to make matters more confusing, I created a test rails app with similar code to the above and ... it works in IE! So this must be something specific to my application. Any ideas? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Adam Groves wrote:> Some additional info: > > For some reason, the above works in IE 6 & 7 when I replace the .rjs > with an inline rjs in the controller action. > > And to make matters more confusing, I created a test rails app with > similar code to the above and ... it works in IE! > > So this must be something specific to my application. > > Any ideas?So you''ve confirmed that the action gets hit (since the inline RJS works) ? Firebug installed in Firefox would at least allow you to see whats was coming fdown the pipe. Removing the evaluiate_response and dumping the response text in an alert box might let you see the javascript in IE. Alan -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for the reply Alan. I think that with rjs, the :complete bit in a link_to_remote is superflous now. At least, it works without it. And changing to :complete => "alert(request.responseText)" doesn''t alter anything: it still executes in Safari & FF (and not in IE). I''ve got firebug and that shows everything to be working as it should. The only thing I can think of is that for some reason, the response text from my rjs templates is not being interpretted by IE (poss wrong content type?). I''ve also got this in my rhtml template for debugging purposes. In Safari and FF, it shows the request url and response text, but in IE it just shows the url. <div id=''debug''> </div> <script type="text/javascript"> Ajax.Responders.register({ onCreate: function(request, transport) { $(''debug'').innerHTML = ''<p><strong>'' + request.url + ''</strong></p>''; }, onComplete: function(request, transport) { if (transport.responseText.match(/<html>/) != null) { $(''debug'').innerHTML = transport.responseText; } else { $(''debug'').innerHTML = ''<p><strong>'' + request.url + ''</strong></p><pre>'' + transport.responseText.escapeHTML() + ''</pre>''; } } }); </script> </div> I''m confused ... -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I just said that firebug was showing everything to be ok but I checked the HEADERS tab in console and what do you know? .... the content-type is text/html! In my test app, it''s text/javascript. Bizarre! -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
In case anyone''s interested - problem solved! I''ve been developing this app for over a year now and forgot about this little before filter: def configure_charsets @headers["Content-Type"] = "text/html; charset=utf8" end Whoops! Thanks anyway Alan for replying. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Adam Groves wrote:> In case anyone''s interested - problem solved! > > I''ve been developing this app for over a year now and forgot about this > little before filter: > > > def configure_charsets > @headers["Content-Type"] = "text/html; charset=utf8" > end > > > Whoops! > > Thanks anyway Alan for replying.:-) Glad you got it sorted out. It still seems odd to me though, that you didn''t get the alert in IE. Even if it was being send with text/html, I''d have thought it wouldn''t evalutae_response, but it *would* have displayed the javascript. Weird. A. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---