Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Released under the MIT License in 2014. http://opensource.org/licenses/mit-license */ | |
function isNodeList(nodes) { | |
var stringRepr = Object.prototype.toString.call(nodes); | |
return typeof nodes === 'object' && | |
/^\[object (HTMLCollection|NodeList|Object)\]$/.test(stringRepr) && | |
nodes.hasOwnProperty('length') && | |
(nodes.length === 0 || (typeof nodes[0] === "object" && nodes[0].nodeType > 0)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var IE = (function() { | |
if (document.documentMode) { | |
return document.documentMode; | |
} else { | |
for (var i = 7; i > 4; i--) { | |
var div = document.createElement("div"); | |
div.innerHTML = "<!--[if IE " + i + "]><span></span><![endif]-->"; | |
if (div.getElementsByTagName("span").length) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ = jQuery | |
TIMEOUT = 20000 | |
lastTime = (new Date()).getTime() | |
setInterval -> | |
currentTime = (new Date()).getTime() | |
# If timeout was paused (ignoring small | |
# variations) then trigger the 'wake' event | |
if currentTime > (lastTime + TIMEOUT + 2000) |