Created
January 31, 2011 11:54
-
-
Save ah01/803945 to your computer and use it in GitHub Desktop.
Tune Up jsFidler
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 () { | |
var output; | |
function getOutput () { | |
if (!output) { | |
output = document.body.appendChild(document.createElement("pre")); | |
} | |
return output; | |
} | |
// Call these functions only after DOM Ready! | |
window.log = function (text) { | |
getOutput().innerHTML += text + "<br>"; | |
} | |
window.assert = function (value, description) { | |
var item = document.createElement("div"); | |
item.style.color = value ? "green" : "red"; | |
item.innerHTML = description; | |
getOutput().appendChild(item); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment