How to quickly test some javascript code?


What would be a good way to test Javascript on a browser? Should there be a localhost in my computer? and how to create one?

This question is tagged with javascript

~ Asked on 2012-01-15 13:00:12

The Best Answer is


Following is a free list of tools you can use to check, test and verify your JS code:

  1. Google Code Playground
  2. JavaScript Sandbox
  3. jsbin
  4. jsfiddle
  5. pastebin
  7. firebug

Hope this helps.

~ Answered on 2012-01-15 13:55:55


If you want to edit some complex javascript I suggest you use JsFiddle. Alternatively, for smaller pieces of javascript you can just run it through your browser URL bar, here's an example:

javascript:alert("hello world");

And, as it was already suggested both Firebug and Chrome developer tools have Javascript console, in which you can type in your javascript to execute. So do Internet Explorer 8+, Opera, Safari and potentially other modern browsers.

~ Answered on 2012-01-15 13:07:30

Most Viewed Questions: