How to get console inside jsfiddle

2019-01-16 18:09发布

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?

5条回答
霸刀☆藐视天下
2楼-- · 2019-01-16 18:19

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
查看更多
你好瞎i
3楼-- · 2019-01-16 18:22

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!

查看更多
一夜七次
4楼-- · 2019-01-16 18:32

works fine... here

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

console = {
    log: function (text) {
        $("#console-log").append($(consoleLine).html(text));
    }
};
console.log("Hello Console")
查看更多
戒情不戒烟
5楼-- · 2019-01-16 18:34
  • 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

查看更多
倾城 Initia
6楼-- · 2019-01-16 18:40

Hit the javascript gear and select firebug lite.

Link to image showing how it is done

查看更多
登录 后发表回答