Skip to content
View gist:2001626
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
View gist:2001617
(function($)
{
var o = $( {} );
$.each({ on: 'subscribe', trigger: 'publish', off: 'unsubscribe' }, function(key, api)
{
$[api] = function(){ o[key].apply(o, arguments); }
});
})(jQuery);
View gist:2001608
.ir { border: 0; font: 0/0 a; text-shadow: none; color: transparent; background-color: transparent; }
View gist:2001600
// Works in modern browsers + IE9, but Modernizr has a polyfill baked in for function.bind.
// Hat tip Paul Irish
var o = $( {} );
$.subscribe = o.on.bind(o);
$.unsubscribe = o.off.bind(o);
$.publish = o.trigger.bind(o);
View gist:2001566
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" href="./css/reset.min.css" />
<link rel="stylesheet" href="./css/main.css" />
</head>
<body>
Something went wrong with that request. Please try again.