Last active
December 15, 2015 10:38
-
-
Save ojak/5247073 to your computer and use it in GitHub Desktop.
Test for XHR when server returns when 204 is encountered on Firefox 19. See Firefox Ticket: https://bugzilla.mozilla.org/show_bug.cgi?id=521301
See jQuery Ticket: http://bugs.jquery.com/ticket/13654
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET http://localhost:8082/204 204 No Content error | |
XML Parsing Error: no element found Location: moz-nullprincipal:{57add04d-95ad-5842-bfe9-8e2e5e563b98} Line Number 1, Column 1: | |
XMLHttpRequest { readyState=4, timeout=0, withCredentials=false, more...} | |
[error ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
var xhr = new XMLHttpRequest(); | |
xhr.open( "GET", "http://localhost:8082/204" ); | |
xhr.onsuccess = function() { | |
console.log( "success", xhr, arguments ); | |
}; | |
xhr.onerror = function() { | |
console.log( "error", xhr, arguments ); | |
}; | |
xhr.onabort = function() { | |
console.log( "abort", xhr, arguments ); | |
}; | |
xhr.ontimeout = function() { | |
console.log( "timeout", xhr, arguments ); | |
}; | |
xhr.send(); | |
</script> | |
</head> | |
<body> | |
See console. | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http { | |
# Include default mime types | |
include mime.types; | |
server { | |
listen 8080; | |
server_name localhost; | |
# Serve this page | |
location = /xhr.html { | |
autoindex on; | |
default_type text/html; | |
alias /path/to/test/file/; | |
} | |
# Error code tests | |
location = /200 { | |
return 200 ''; | |
} | |
location = /204 { | |
return 204; | |
} | |
} | |
server { | |
listen 8082; | |
server_name localhost; | |
# Error code tests | |
location = /200 { | |
return 200 ''; | |
} | |
location = /204 { | |
return 204; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment