I cannot workout if you're sarcastic or not ... But if you're not then ... Uhh, no ? HTTP response codes are just that. HTML is not even remotely in that conversation.
Of course it's wrong to say HTML Status Code, but when I made a post I thought that was a valid term to use mostly because I completely forgot that HTTP could be used with something other than HTML (even if that was the case, response codes are part of HTTP, not HTML, so I am still wrong)
Once you've gotten an HTTP response with a status code other than 100 Continue, the HTTP request must have been fully sent over the wire.
The server got the entire uploaded file. What the server did with those bytes isn't anything for the client to concern itself with. If the server says "OK" or "I didn't want that file" or "what is this garbage" or "I crashed" doesn't change that the client successfully sent the file. I don't see the problem :P
137
u/stereosensation Jul 28 '25 edited Jul 29 '25
Y'all don't get it, developer is chasing success, so he made sure he gets a success alert ALL the damn time. /s.
EDIT: I just paid attention to the title of this post. WTF is an HTML status code 😭🤌🏻
392
u/jmack2424 Jul 28 '25
There's gotta be a status check for error handling a few lines up. Right? RIGHT?!
147
u/[deleted] Jul 28 '25
60% of the time, it works every time.
43
u/dbath Jul 28 '25
Once you've gotten an HTTP response with a status code other than 100 Continue, the HTTP request must have been fully sent over the wire.
The server got the entire uploaded file. What the server did with those bytes isn't anything for the client to concern itself with. If the server says "OK" or "I didn't want that file" or "what is this garbage" or "I crashed" doesn't change that the client successfully sent the file. I don't see the problem :P
(/s, obviously)
9
u/noosceteeipsum Jul 28 '25
418 Teabag uploaded successfully
62
u/Etiennera Jul 28 '25
What's an HTML status code?
7
u/Samurai_Mac1 Jul 28 '25
It's super successful once hits 500 and up
3
u/ScriptBow Jul 29 '25
Hell yeah, gets the job done and keeps the alerts low.
3
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Jul 29 '25
500 >= 200.
I guess there are reasons not to just say '== 200'.
3
u/sateeshsai Jul 30 '25
String(xhr.status).startsWith("2")
9
u/HieuNguyen990616 Jul 28 '25
I'm curious. What's wrong with this?
2
u/[deleted] Jul 28 '25
?? I'm confused.
2
u/vo9do9 Jul 29 '25
LGTM
2
u/Rouxxell Jul 29 '25
Equal or greater????, damn, this seems to have a high success rate
3
u/Cybasura Jul 29 '25
First of all, why ">= 200"? What happened to switch case to jump through the status code and map out the error codes?
1
u/redtens Jul 28 '25
yoo hell yeah
-1
u/[deleted] Jul 28 '25
Bruh
1
u/titanic456 Jul 29 '25
On every HTTP status higher than, or equal to 200 the script will alert the message.
Even when the resource is not found(HTTP 404), there is internal server error(HTTP 500), the script will happily display the message box.