How to quickly test some javascript code?

49

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


35

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
  6. jsdo.it
  7. firebug
  8. html5snippet.net

Hope this helps.

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


8

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: