Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Feature detect base64 support for images in mootools

View Browser.features.base64.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
(function() {
var callback = function() {
Browser.Features = Object.merge(Browser.Features, {
base64: this.width == 1 && this.height == 1
});
// console.log(Browser.Features.base64); // true || false
};
new Element("img", {
// 1x1 px gif to test with
src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",
events: {
load: callback,
error: callback
}
});
})();

is it humanly possible to make more mistakes on a less-than-10 lines snippet? hopefully it's now done and dusted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.