How to get console inside jsfiddle

2019-01-16 17:58发布

问题:

How can I get the console to show in a fiddle on JSfiddle.com?

I recently saw a fiddle that had the console embedded in the fiddle, anyone know how this can be done?

回答1:

Hit the javascript gear and select firebug lite.



回答2:

pretty simple one..

example

github

Just add the following URL to External Resources in jsfiddle, you will see console.log and console.error in the result screen.

https://rawgit.com/eu81273/jsfiddle-console/master/console.js


回答3:

works fine... here

var consoleLine = "<p class=\"console-line\"></p>";

console = {
    log: function (text) {
        $("#console-log").append($(consoleLine).html(text));
    }
};
console.log("Hello Console")


回答4:

  • click on that arrow next to JavaScript
  • and as FRAMEWORKS & EXTENSIONS select No-Libary (Pure JS)
  • paste your console.log('foo'); in JS box
  • under Resources add https://rawgit.com/eu81273/jsfiddle-console/master/console.js
  • and run your script hitting that Play button



回答5:

Lately, I couldn't find ANY option for selecting Firebug extension in Javascript Gear Option and I am lazy enough to add external links/libraries, and yet there is another SIMPLE solution.

Use Browser's built in Console as I have used and shown in this demo link. Click Me!