user2040597 user2040597 - 2 months ago 20
jQuery Question

How to see the tab eol spaces in chrome console?

I receive some data after a jQuery

and I would like to be able to see all the non visible characters like spaces, tabs, end of line or new line. Is it possible to see this in chrome console? How?


One way would be to a manual replace for all possible whitespace characters:

var html = '\n\t';
console.log(html); // displays whitespace
console.log(html.replace(/\n/g,'\\n').replace(/\t/,'\\t')); // displays '\n\t'

Quite tedious, I know.