link_to_remote generates the javascript: new Ajax.Updater(...). Have I missed something or doesn''t this handle browsers with javascript support but without XHR support? What I''d like to do is: 1. If the browser supports XHR, use XHR 2. If the browser supports javascript (and perhaps even if the XHR request fails) do a POST via javascript 3. If the browser doesn''t support javascript use POST via a standard form Is that possible? Thanks in advance, Jonas Bengtsson http://andthennothing.net -- Posted via http://www.ruby-forum.com/.
did you include this in your header? <%= javascript_include_tag ''prototype'', ''scriptaculous'' %> as well as have those files in your javascripts folder found in the public directory? there is also a url_for attribute that you can add to your link_to_remote that will do a post if the browser does not have javascript turned on or does not support it. Andrew On Dec 15, 2005, at 7:15 AM, Jonas Bengtsson wrote:> link_to_remote generates the javascript: new Ajax.Updater(...). Have I > missed something or doesn''t this handle browsers with javascript > support > but without XHR support? > > What I''d like to do is: > 1. If the browser supports XHR, use XHR > 2. If the browser supports javascript (and perhaps even if the XHR > request fails) do a POST via javascript > 3. If the browser doesn''t support javascript use POST via a standard > form > > Is that possible? > > Thanks in advance, > > Jonas Bengtsson > http://andthennothing.net > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Thanks for your answer Andrew, Andrew Filipowski wrote:> did you include this in your header? > > <%= javascript_include_tag ''prototype'', ''scriptaculous'' %> > > as well as have those files in your javascripts folder found in the > public directory?Yes. link_to_remote works when I use a browser with XHR support so everything is set up correctly.> there is also a url_for attribute that you can add to your > link_to_remote that will do a post if the browser does not have > javascript turned on or does not support it.Do you mean options[''url'']? Won''t it just do a GET on that url if javascript is turned off (I want a POST)? And that still don''t address browsers without XHR support. /Jonas -- Posted via http://www.ruby-forum.com/.