Perry Smith
2007-Aug-12 18:42 UTC
RESTful and "graceful" degrade if javascript is disabled
I''m trying to resolve a sort of personal conflict. On the one hand, I want to use the new nifty javascript things. In the case of the application I''m writing, it would make the user interface usable and I can''t figure out how to do a usable user interface without javascript. But on the other hand, I have heard loud and clear that a "good" site should degrade gracefully if javascript is disabled. But something kept buzzing around in my head about something that does not really happen, it actually invokes a small piece of javascript... yada yada yada... I couldn''t remember what it was. I figured it out. For one, the "delete" links for a RESTful application invoke javascript ''onclick'' to submit the request and add in the ":method => delete". For curiosity, I disabled javascript and poked the link to see how did it work if javascript was disabled. Answer: it does nothing -- really. It sends a request for the page that you are currently looking at. So... is this considered a graceful degradation? There is no way to delete objects in a normlal Rails RESTful implementation. It doesn''t even say "Loser!". It just redraws the screen. pedz -- 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 -~----------~----~----~----~------~----~------~--~---
Rick Olson
2007-Aug-12 21:29 UTC
Re: RESTful and "graceful" degrade if javascript is disabled
On 8/12/07, Perry Smith <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I''m trying to resolve a sort of personal conflict. > > On the one hand, I want to use the new nifty javascript things. In the > case of the application I''m writing, it would make the user interface > usable and I can''t figure out how to do a usable user interface without > javascript. > > But on the other hand, I have heard loud and clear that a "good" site > should degrade gracefully if javascript is disabled. But something kept > buzzing around in my head about something that does not really happen, > it actually invokes a small piece of javascript... yada yada yada... I > couldn''t remember what it was. > > I figured it out. For one, the "delete" links for a RESTful application > invoke javascript ''onclick'' to submit the request and add in the > ":method => delete". For curiosity, I disabled javascript and poked the > link to see how did it work if javascript was disabled. Answer: it does > nothing -- really. It sends a request for the page that you are > currently looking at. > > So... is this considered a graceful degradation? There is no way to > delete objects in a normlal Rails RESTful implementation. It doesn''t > even say "Loser!". It just redraws the screen.Nope. Just like with ''unrestful'' apps, you need to specify a valid fallback page. If there''s no javascript, the onclick is ignored, and whatever is in the href attribute is followed. This could be pointed at some sort of delete confirmation page if you want. -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.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 -~----------~----~----~----~------~----~------~--~---