An open API service indexing awesome lists of open source software.

https://github.com/benbowes/jsfiddle-value-printer

Prints values in the result panel....
https://github.com/benbowes/jsfiddle-value-printer

Last synced: 6 months ago
JSON representation

Prints values in the result panel....

Awesome Lists containing this project

README

          

# jsfiddle-value-printer
For printing values in the result panel... for when you're too lazy to open the inspector to view console.log() output.

### In the HTML window...
```javascript

Results


var index = 0;
var printResult = function(msg) {
index++;
var result = '<p class="results__result">';
result += '<span class="results__result-index">' + index + ': </span>';
result += JSON.stringify(msg, null, 2) + ';'
result += '</p>';
document.querySelector('.results').innerHTML += result;
}

```

### In the CSS window...
```css
body {
font-family: sans-serif;
padding: 1em;
}

.results {
padding: 0.5em 1em;
background: #fff;
display: block;
}

.results__result:not(:last-child) {
border-bottom: 1px solid #f1f1f1;
}

.results__result {
padding: 1em;
}

.results__result-index {
color: #ccc;
}

```