Created
September 13, 2014 10:10
-
-
Save boichee/e8dc65ef4c9ebb65295a to your computer and use it in GitHub Desktop.
Simple console emulator for JSFiddle
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
// JS Console Emulator | |
console = { | |
log: function (text) { | |
console.linecount = console.linecount++ || 1; | |
if (console.linecount === 1) $("#console-log").empty(); | |
$("<p/>", { | |
html: text | |
}).appendTo("#console-log"); | |
} | |
}; | |
// Any code below here sent to console.log will output to the Result pane like a console. | |
console.log("It works!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment