Testing and Debugging

If you want a safe environment in which to experiment and test your scripts, resources like JS Bin and JS Fiddle are ideal. Both work in basically the same way, but as I tend to use JS Bin, I’ll cover it in this section.

JS Bin provides up to five columns for you to run your scripts in: The first three columns are for providing the HTML, CSS, and JavaScript that you’ll use for your tests; a Console is available for logging results and information; and an Output panel shows the results of the tests.

A list of popular JavaScript libraries is available in a drop-down menu, and choosing any of them automatically adds them to the head of your example markup. You can also manually add any libraries that aren’t in the list (such ...

Get The Modern Web now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.