Mention hanging on synchronous requests
Wed Oct 27 22:01:20 UTC 2010 pix@kepibu.org
* Mention hanging on synchronous requests
hunk ./form-to-http-auth.js 6
+
hunk ./form-to-http-auth.js 11
+ var form = this;
hunk ./form-to-http-auth.js 14
+ /* synchronous hangs some browsers temporarily. :/ */
hunk ./form-to-http-auth.js 22
+ },
+ error: function (xhr, status, err) {
+ authed = false;
+ },
+ complete: function (xhr, status) {
+ /* Don't send username and password if we successfully managed to auth via HTTP */
+ if (authed) {
+ form.username.parentNode.removeChild(form.username);
+ form.password.parentNode.removeChild(form.password);
+ }
hunk ./form-to-http-auth.js 34
- /* Don't send username and password if we successfully managed to auth via HTTP */
- if (authed) {
- this.username.parentNode.removeChild(this.username);
- this.password.parentNode.removeChild(this.password);
- }
+
+ /* This is the only way to get browsers to submit the form exactly as
+ the user did, which is why we aren't using async above. */