3 ms·
It didn't encourage REST either. It provided $.post but not $.del (since delete is a keyword in JavaScript) so one could even say it went against REST. I think
by benatkin 8y ago
It didn't encourage REST either. It provided $.post but not $.del (since delete is a keyword in JavaScript) so one could even say it went against REST. I think it was orthogonal to REST, though.
Here's the docs for jQuery 1.3 from when REST was starting to take off, with jQuery.post but no delete method: https://api.jquery.com/category/ajax/shorthand-methods/ https://api.jquery.com/category/ajax/shorthand-methods/
- anothergoogler 8y agoREST had taken off before jQuery existed.
- abritinthebay 8y agoIt provided $.ajax({method: “DELETE”}) however... so...
- anothergoogler 8y agoMaking a DELETE XHR was never the issue, browser support was. It's an issue that was impossible to paper over with a JS library alone, you needed backend integration. That's why Rails and similar frameworks at the time spoofed DELETE and PUT requests by creating a POST request with a special param set.
- benatkin 8y agoIt was also an issue on backends. Backbone had an emulateHTTP option: http://backbonejs.org/#Sync-emulateHTTP http://backbonejs.org/#Sync-emulateHTTP
- abritinthebay 8y agoAll browsers supported the verbs for years. IE7 had mostly full support (not PATCH though, annoyingly). The problem was mostly backend related: most servers didn't support them. DELETE for example has been supported for over 12 years in all major browsers.
- anothergoogler 8y agoAh, interesting, my memory is dusty. Now that I think about it, the limitations of <FORM> were front and center too: A Rails app wanted a "delete $X" page that didn't rely on JS, and the only way that was going to happen was with a <FORM>, which only supports GET and POST methods.
- abritinthebay 8y agoAh well yes. That’s quite intentional of course but yeah, an architectural limitation of that Rails app. Of course until ~v3 Rails didn’t fully support all verbs so...