views:

174

answers:

4

is there an online javaScript code snippets resource that lets you run code?

this would especially be useful for example code when trying to answer questions on SO!

thanks,

Josh

+7  A: 

I prefer JS Bin (and use it a lot for examples here on SO.) It allows you to save your JavaScript & HTML online, which is a big requirement for me. Also, it provides easy access to all of the frameworks in the Google AJAX Libraries API.

moff
perfect - just what i was looking for
Josh
A: 

W3schools.com does ... Try the "TryIt Editor".

I'm not sure how complex they allow scripts to be, though.

Rob
+1  A: 

How about this website?

I normally just keep a shell HTML file on my desktop with the minimal amount of tags and some script tags so I can try stuff out using it before I post my answers.

Perspx
A: 

Use Firebug and open up the console. You can choose options -> "larger command line" to paste in multiple lines of javascript.

The advantage of using Firebug is that you can execute the JavaScript in the context of whatever page is currently open. This means you can test a function that accesses the DOM of your page and see that it works correctly.

I highly recommend this method of testing if you are doing any serious JS development.

ifwdev