I've been taking a bit of a coding vacation. Before I jump back into things, I decided to do a little housekeeping and clean the cobwebs from my interwebs. Specifically, reducing the level of annoying coming out of Facebook.
Look at this nonsense right here:
<form rel="async" action="/ajax/settings/notifications/update_app" method="post" onsubmit="return window.Event && Event.__inlineSubmit && Event.__inlineSubmit(this,event)" id="u_o_e"> <input type="hidden" name="fb_dtsg" value="...." autocomplete="off"> <img class="uiLoadingIndicatorAsync img" src="https://fbstatic-a.akamaihd.net/rsrc.php/v2/yb/r/GsNJNwuI-UM.gif" alt="" width="16" height="11"> <input type="checkbox" name="checked" checked="1" id="u_o_f"> <input type="hidden" autocomplete="off" name="id" value="12345"> </form>
The REST style is a document based style. It tends to favor coarse-grained resources over fine-grained ones, if only for the cache-ability.
GET /user/12345/application-notifications Accept: text/html Authorization: ... 200 Ok Content-Type: text/html Cache-control: private <html> <body> <form action="/user/12345/application-notifications" method="POST" id="application-notifications"> <!-- each value here represents an application id --> <input type="checkbox" name="id" value="12345" checked > <input type="checkbox" name="id" value="67890" > <input type="Submit" value=" Submit " > </form> </body> </html>
Admittedly, the user experience has not improved over what Facebook is currently providing us. However, there are two improvements. 1) Only one remote call to set all preferences at once. 2) A lot less complicated than putting an ajax form around each checkbox and having to wire that up.