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 MyString = function(string) { | |
var new_string = []; | |
var current_toString = string; | |
for (var char_index in string) { | |
new_string[char_index] = string[char_index]; | |
} | |
/* | |
Returns a primitive string representation of this string. | |
*/ |
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 MyArray = function() { | |
var new_array = {}; | |
var current_length = 0; | |
var arguments_length = arguments.length; | |
for (var index = 0; index < arguments_length; index++) { | |
new_array[index] = arguments[index]; | |
} | |
var calc_length = (function() { |
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 pseudoClassicalExtend = function(child, parent){ | |
function F(){}; | |
F.prototype = parent.prototype; | |
child.prototype = new F(); | |
child.prototype.constructor = child; | |
child.uber = parent.prototype; | |
}; | |
var prototypalInheritance = function(parent){ | |
function F(){}; |
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 travelDOMland(callback, elem){ | |
elem = elem || document.body; | |
callback(elem); | |
if(elem.hasChildNodes()){ | |
travelDOMland(callback, elem.firstChild); | |
} | |
if(elem.nextSibling !== 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 earthquakeWindow = (function(){ | |
var x = 0; | |
var y = 0; | |
var width = 400; | |
var height = 400; | |
var newWindow = window.open("","", "width="+ width +", height="+ height + ", resizable=yes"); | |
var resizeMoveWindow = function(){ | |
x=Math.random() * 1400; | |
y= Math.random() * 900; | |
width += 10; |
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 safelyRemoveNodes = function(node){//Only works in Firefox, event handlers are not enumerable in Safari and Chrome | |
if(node.firstElementChild){ | |
safelyRemoveNodes(node.firstElementChild); | |
} | |
if(node.nextElementSibling){ | |
safelyRemoveNodes(node.nextElementSibling); | |
} | |
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 grandParent(element, grandParentId) { | |
if (element === document.body) { | |
return null; | |
} | |
if (element.id === grandParentId) { | |
return element; | |
} | |
if (element.parentNode === 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
<html> | |
<head> | |
<script type="text/javascript"> | |
function include(src) { | |
var script = document.createElement("script"); | |
script.src = src; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
} | |
function searchCallback(results) { |
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
<html> | |
<head> | |
<script type="text/javascript"> | |
var myApp = { Utils:{}}; | |
(function(host){ | |
MyEvent = {}; | |
var callbackEvent = function(evt){ | |
evt = evt || window.event || {}; |
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
<html> | |
<head> | |
<style type="text/css"> | |
p{ | |
font-family: Helvetica; | |
font-size: 24px; | |
} | |
</style> | |
<script type="text/javascript"> |
OlderNewer