Last active
August 29, 2015 14:13
-
-
Save jxc876/ce2715315ead2b990bfe to your computer and use it in GitHub Desktop.
Log on
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
/* | |
REQUIREMENTS: | |
--------- | |
1) JQuery is required | |
2) Create a element with the id of "console-log" | |
EX: <div id="console-log"></div> | |
USAGE: | |
--------- | |
console.log('hello'); | |
OPTIONAL | |
--------- | |
Add a .console-line class, EX: | |
.console-line { | |
font-family: monospace; | |
margin: 2px; | |
} | |
*/ | |
console = { | |
count: 0, | |
consoleLine: "<p class=\"console-line\"></p>", | |
log: function (par1) { | |
$console = $("#console-log"); | |
if (par1 !== null && typeof par1 === 'object') { | |
$console.append($(this.consoleLine).html(this.count+++': ' + JSON.stringify(par1))); | |
} | |
else { | |
$console.append($(this.consoleLine).html(this.count+++': ' + par1)); | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment