Skip to content

Instantly share code, notes, and snippets.

@boichee
Created September 13, 2014 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boichee/e8dc65ef4c9ebb65295a to your computer and use it in GitHub Desktop.
Save boichee/e8dc65ef4c9ebb65295a to your computer and use it in GitHub Desktop.
Simple console emulator for JSFiddle
// 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