I've always used a redirect after user submits data, because it makes more sense to me to have user be looking at something he/she http-got, so the page can be refreshed without a confusing "re-send data" dialog by the web browser and without unnecessary data re-submission potentially resulting a data add/overwrite.
I've been doing it with HTTP 301 redirect, apparently there is something that makes more sense
HTTP 303 See Other
According to RFC 7231, which obsoletes RFC 2616, "A 303 response to a GET request indicates that the origin server does not have a representation of the target resource that can be transferred by the server over HTTP. However, the Location field value refers to a resource that is descriptive of the target resource, such that making a retrieval request on that other resource might result in a representation that is useful to recipients without implying that it represents the original target resource."
This was new to me in May 2016, he he. In the world where many websites don't even do form-submit any more, all Ajax and such. But many people believe HTTP 303 makes sense for REST API responses:
https://adayinthelifeof.nl/2012/05/02/301-vs-303/
During this presentation (and blog-post), I’m using a 303 HTTP status code to indicate that the operation has been completed and that the created resource can be found at another URI.
Codissey - Coding Odyssey
Not sure yet which direction this blog is going, but I'll start posting random findings, unusual problems (and solutions) that I've encountered in my day to day (coding) life. P.S. Odyssey subdomain was taken, but spelling Odissey with an "i" is also acceptable!
Monday, May 16, 2016
Wednesday, April 1, 2015
Google Chrome "Aw, Snap" error due to invalid A.HREF
I was receiving "Aw, Snap" in Google Chrome when a certain page of my site was loading, the offending content was being loaded with AJAX call, but I'll save you time by not describing my troubleshooting process.
It all boiled down to this link (changed from original):
<a href="http://this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20">link with bad href</a>
Note
This didn't happen in Chrome 40.0.2214.115, but version 41.0.2272.118 died.
It all boiled down to this link (changed from original):
<a href="http://this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20this%20is%20some%20text%20">link with bad href</a>
Example Page
Test page that loads in IE, FireFox, but crashes Chrome:Note
This didn't happen in Chrome 40.0.2214.115, but version 41.0.2272.118 died.
Subscribe to:
Posts (Atom)