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
//Source code on [Professional JavaScript for Web Developers] | |
var client = (function() { | |
var engine = { | |
//Graphic Engine | |
ie: 0, | |
gecko: 0, | |
webkit: 0, | |
khtml: 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
//Detect if otherNode is contained by refNode | |
function contains(refNode, otherNode) { | |
var node = other.Node.parerntNode; | |
do { | |
if (node === refNode) { | |
return true; | |
} else { | |
node = node.parentNode; | |
} | |
} while (node !== null); |
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 bool = !!arg; | |
var str = arg + ""; | |
var num = arg * 1; | |
var arr = Array.prototype.slice.call(arg, 0); | |
//Str <=> Arr | |
var arr = arg.split(""); | |
var str = arg.join(""); |
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
function getQueryStringArgs() { | |
var qs = (location.search.length > 0 ? location.search.substring(1) : ""); | |
var args = {}; | |
var items = qs.split("&"); | |
var item = null, | |
name = null, | |
value = null; |
NewerOlder