Radio buttons and checkboxes styles with JQuery

Interesting JQuery plugin which allow us to style radio buttons and checkboxes elements.

ezMark is a JQuery plugin which allows us to easily stylize radio buttons and checkboxes. It’s a very little plugin (minified version ~1.5kb) compared with other plugins. Also, it was successfully tested in most of browsers (Firefox, Chrome, Safari, IE 6/7/8).

To customize the default images for radiobutton/checkbox, we just need to change the following background images (checkbox-black.png/radio-black.png) and the CSS (ez-checkbox/ez-radio and ez-checked/ez-selected) with your preferences.

That is, you can see the plugin working here.

HTTP Errors

A list of most known HTTP errors.

These errors belong to the HTTP/1.1 standard and they are classified in five different types.
The five different defined types are:

1xx. Informational. The request is received and it continues with the process. The errors in this range indicate provisional responses. The Web Servers should not send 1xx errors to the client, except under experimental conditions.

2xx. Success. These errors indicate that the request was received, understand, accepted and successfully processed.

3xx. Redirection. In this range the client should do aditional actions to complete the request. The required action should be carry by the User Agent with no user interaction only if the method is GET or HEAD. The user agent should not automatically redirect more than five times, if not is considered an infinite loop.

4xx. Client Errors. These errors are triggered when the error is in the client.

5xx. Server Errors. The server fails when it looks like the request is not valid or the server is unable to do the request.

1xx Informational.

100 Continue. The server has received the request headers and the client should proceed to send the request body.

101 Switching Protocols. The client asks to the server to change protocols and the server knows if it could do it.

102 Processing. As a request can contain many sub-headers, this could take so much time to complete the request. This error indicates that the server has received and is processing the request, but it does not response that it’s not available yet. This avoids the client to assume that the request was lost.

2xx Success.

200 OK. This is the standard response for a successful HTTP request. The response will depend in the used method (GET, PUT, POST, etc).

201 Created. The request has been completed and the response is that a new resource was created.

202 Accepted. The request has been accepted to be processed, but it has not been completed yet.

203 Non-Authoritative Information. The server has processed the request successfully, but it’s returning information what could be from another source.

204 No Content. The server processed the request successfully, but there is not content to return.

205 Reset Content. It’s identical to 204 error but with the difference of the response requires the client to reset the resource.

206 Partial Content. The server is returning the resource partially. This error is used in tools like wget.

207 Multi-Status. The body of the response is a XML message and it could contain separated status depending in how much sub-requests were done.

3xx Redirect.

300 Multiple Choices. It indicates multiple options for the resource the user is requesting. For instance, it could be used to present different options to video formats.

301 Moved Permanently. The current request and all future requests to the requested resource should be redirected to the given url.

302 Found. This is the most popular redirect error, the HTTP/1.0 requires the client to make a temporal redirect, but the most popular browsers implement 302 error as 303 error. Therefore, HTTP/1.1 added the 303 and 307 errors to distinguish between these two behaviors, most web applications still use the 302 errors like a 303 error.

303 See Other. This error was added in HTTP/1.1. The response for the rrequest could be find in other URI using the GET method.

304 Not Modified. It indicates that the resource was not modified since the last request.

305 Use Proxy. This error was added in HTTP/1.1. Some HTTP clients (like Mozilla and Internet Explorer) do not handle this error properly, mainly due to security reasons.

307 Temporary Redirect. This error was also added in HTTP/1.1. In this case, the request should be repeat it with another URI, but the future requests could use the original URI. In contrast with 303 error, the HTTP method should not be changed.

4xx Client Errors.

400 Bad Request. The request contains wrong syntaxis or it could not be completed.

401 Unauthorized. This error is similar to 403, but it is specifically used when the user can authenticate but the authentication has been failed or has not been entered the authentication credentials yet.

402 Payment Required. This error is reserved for future uses and it’s thinking to be used for applications those make payments.

403 Forbidden. The request was legal, but the server rejects to response it.

404 Not Found. The requested resource is not found, but it could be in the future.

405 Method Not Allowed. The resource was requested via a not allowed HTTP method. For instance, try to process a form with a GET method instead of a POST.

406 Not Acceptable. The requested resource only can generate content no acceptable by the request headers.

407 Proxy Authentication Required.

408 Request Timeout. The server triggered a timeout.

409 Conflict. It indicates tha the request could not be processed due to a conflict.

410 Gone. It indicates that the requested resource is not available anymore. This error should be used when a resource was intentionally removed, although a 404 error could be returned.

411 Length Required. The request does not specify the content length which is a requirement for the requested resource.

412 Precondition Failed. The server does not accomplish with some pre-conditions that the user is requesting.

413 Request Entity Too Large. The request is to big to be processed.

414 Request-URI Too Long. The entered URI was too long to be processed.

415 Unsupported Media Type. The request does not specify none type of media. For instance, the client specifies the requested resource as image/svg+xml format, but the server does not find a resource with that format.

417 Expectation Failed. The server could not meet the requirements in the request headers.

422 Unprocessable Entity. The request was valid but the server was unable to attend it due to some semantic errors.

423 Locked. The resource which is being accessing is locked.

424 Failed Dependency. The request failed due to previous failed requests.

426 Upgrade Required. The client should be changed to a different protocol, for instance to TLS/1.0.

5xx Server Errors.

500 Internal Server Error. It is a generic error message and it’s returned when there is not a more specific error.

501 Not Implemented. The server neither recognizes the HTTP request method nor have the ability to complete the request.

502 Bad Gateway. The server was working as a gateway or proxy and it received an invalid response from the downstream server.

503 Service Unavailable. The server is not currently available (due to an overload or because it’s in maintenance). Generally, this error is temporal.

504 Gateway Timeout. The server did not receive a response in time.

505 HTTP Version Not Supported. The server does not support the HTTP protocol version used by the request.

Transparent PNGs in Internet Explorer 6

Easy fix for the transparent png issue in IE.

It’s true that I’ve decided to do not bother me to make the things work for Internet Explorer 6 and/or lower, always there is the need to attend client’s requests for the worst web browser ever. In this case, to to the problem witn transparency in PNG images.

To fix this bug we should download this file. After uncompress it we should include the iepngfix.htc and blank.gif files in your web server, then edit the iepngfix.htc file to indicate where you uploaded the blank.gif file. Also, we can read the iepngfix.html page to check how to use it ;-).

With this tool we can fix both the images in and the background images used with CSS; to do that we should add the below line in our css:

1
behavior: url(iepngfix.htc);

Keep on mind to set the right url to the iepngfix.htc file.

If we wish to make the tag to respect the transparent background in IE, we should add:

1
2
3
img{
  behavior: url(iepngfix.htc);
}

If we have a css element with a background image, we should add the behavior to it, for instance if we have a class named .logo, we should add:

1
2
3
4
.logo{
  background: url(images/logo.png) no-repeat left top;
  behavior: url(iepngfix.htc);
}

Well, that’s it! 🙂