Skip to content

Instantly share code, notes, and snippets.

@DimitarChristoff
DimitarChristoff / Browser.features.base64.js
Created February 10, 2011 21:21
Feature detect base64 support for images in mootools
(function() {
Browser.Features.base64 = null;
var callback = function() {
Browser.Features.base64 = this.width == 1 && this.height == 1;
// alert(Browser.Features.base64); // true || false
};
var img = new Image(), img = document.id(img) || new Element("img");
img.onload = img.onerror = img.onabort = callback;
// 1x1 px gif to test with