10

How can i display the console for debugging JavaScript on jsfiddle.net? I only see a results tab. When trying to do a console.log('test'); only a white result tab appears.

Does a console panel exists at all?

MarvHock
  • 793
  • 7
  • 16

7 Answers7

12

Normally by pressing F12 or using inspect on your result pane.

Alternatively add

https://cdn.jsdelivr.net/gh/eu81273/jsfiddle-console/console.js

to the resources on the left as seen here

for (var i = 0; i < 5; i++) {
    console.log(i); // 0, 1, 2, 3, 4
}

console.log({
    foo: 'bar',
    baz: function() {}
});
console.log([1, 2, 3]);
console.log(window.alert);

throw new Error('This is error log..');
<script src="https://cdn.jsdelivr.net/gh/eu81273/jsfiddle-console/console.js"></script>

Old answer

Until recently if you wanted the "Stacksnippet Console" type of console, you could choose jQuery and turn on Firebug which would show console messages in the result pane:

enter image description here

mplungjan
  • 169,008
  • 28
  • 173
  • 236
  • 1
    As of 2020 this [doesn't seem to work](https://jsfiddle.net/kAlvaro/jp27mcgk/1/). I've found a fiddle that [displays the console](https://jsfiddle.net/eu81273/op9wumdz/) without it—I have no idea how it works. – Álvaro González May 01 '20 at 11:35
  • 1
    @ÁlvaroGonzález There is an added js file: https://cdn.jsdelivr.net/gh/eu81273/jsfiddle-console/console.js – mplungjan May 04 '20 at 09:56
1

-- Latest Simple JSFiddle Solution --

JSFiddle now has its own beta settings for displaying the console:

Setting opened on JSFiddle to show console options

which appears at the bottom of the results panel:

enter image description here

allenski
  • 1,652
  • 4
  • 23
  • 39
0

You can open it by right clicking and selecting Inspect Element on that menu or you can use f12 as a shortcut key to open console.

0

You can use the package below to redirect console output in an 'inspection style' manner to the HTML pane.

GitHub: https://github.com/karimayachi/html-console-output

If you also have normal HTML output, you can use CSS to overlay this console or have it stick to the top or bottom.

Basic example (no CSS) here: https://jsfiddle.net/Brutac/e5nsp2mu/

To run it inside jsFiddle, simply add the CDN-version (url below) to the resources (see example).

https://unpkg.com/html-console-output
Karim Ayachi
  • 547
  • 5
  • 11
-1

you can use browser console by

Rightclick > inspect element > console

Shazvan Hanif
  • 361
  • 3
  • 20
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/19930011) – Michel Jun 05 '18 at 07:45
  • @Michel this is as good an answer as the other "Press F12/Right-click" answers above – mplungjan Jun 05 '18 at 08:06
-1

F12, opens the debugger view and on console tab you get the logs. You can filter as required warning/info/errors/all

-1

(Tested on Chrome)
1- Write some simple JS code on the JS pane. e.g.> console.log("hello");
2- Click on "Run".
3- On the "Result" pane, right click and pick "Inspect".
4- Go to the Console.
5- Make sure that you filter your results.(See picture down below).
And do NOT click on "Update" in order to keep a clean console. Every time you want to test new code, just hit "Run" or use shortcut: Ctrl + Enter.

js fiddle console

jet2016
  • 345
  • 1
  • 3
  • 11