About

JS Bin is a webapp specifically designed to help JavaScript and CSS folk test snippets of code, within some context, and debug the code collaboratively.

JS Bin allows you to edit and test JavaScript and HTML (reloading the URL also maintains the state of your code - new tabs doesn't). Once you're happy you can save, and send the URL to a peer for review or help. They can then make further changes saving anew if required.

The original idea spawned from a conversation with another developer in trying to help him debug an Ajax issue. The original aim was to build it using Google's app engine, but in the end, it was John Resig's Learning app that inspired me to build the whole solution in JavaScript with liberal dashes of jQuery and a tiny bit of LAMP for the saving process.

It took me the best part of 4 hours to develop - so if it's shaky around the edges, let me know!

This webapp was built by Remy Sharp (@rem) of Left Logic. Please get in touch if you're interested in working with me.

Video Introduction

Ajax Debugging

FAQ

I didn't insert the JavaScript and it still runs

When you tab to the output panel, JS Bin automatically inserts your JavaScript on the fly, so you don't need to worry about it.

I need my JavaScript inserted in a specific position

The special %code% symbol will be replaced with your JavaScript. If it's not included, it will be included just before the body closes. Otherwise you can add <script>%code%</script> anywhere you like.

How do I re-run the code

Just click the 'Output' tab, and the entire frame will re-execute.

Can I see the output outside of this window?

Yes. First you must save the code, then use the 'Live' link. This is now stored privately and can be shared amongst your peers.

When I click the live link it doesn't reflect my changes

The live link only shows the saved code, any changes must be saved first.

Can JS Bin respond to Ajax requests?

Yes. See the video introduction for a demo. Or, it's as simple as removing the HTML output, saving the code, then requesting the URL via a new snippet. JS Bin will respond to Ajax requests appropriately.

Is there a bookmarklet?

Funny you ask! Yes, just drag the following jsbin bookmarklet to your bookmark bar. The bookmarklet will inject any selected JavaScript in to JS Bin.

IE6?

Sorry: no.

My question isn't answered

Feel free to get in touch and if appropriate I'll add it to the FAQ.