So something I do very frequently is writing random scripts in JS without really being part of an app. To run them I just paste them in the console of either Chrome of FF which works as a nice REPL, or if I really need more fancy debugging I just add it to my test app on localhost and browse it from the browser. Is there a way to get all the good debugging of a browser (breakpoints, locals, etc), without it being served from a server?, e.g by just copy-pasting my code into console or something?
You can use http://jsbin.com/.
I don't think you can place a breakpoint as the script you write is automaticly checked by jsbin in the console window and if there's an error after you refresh it will be paused in debugger.
If you don't refresh the page it will warn you as you type about possible errors.
Also for your information the script you write is parsed by jsbin so it's stored in the edit resource.
If you have php installed you can run a .vbs script to paste contents in a file and run a php server on the fly.
Just copy your JS code to Clipboard and execute this script.
On the other hand, I have a phpserver.BAT file on my shell:sendto folder (Windows) to run a php server for every folder I SendTo->phpServer.bat. It contains the same cmd commands used above.
You were asking about a non-server solution, but this is really fast and useful. To shutdown the on-the-fly server you only have to close the php console window.
Btw, do you know about NodeJs? (JS running on the server, with console, etc)
For FireFox, FireBug and JSFiddle are absolute must haves for debugging. You'll not only be able to debug with breakpoints, but also to modify any data as part of the transaction.
For Chrome, it's built in: https://developers.google.com/chrome-developer-tools/ ... right click an element and then go to inspect. Alternately if you want a single interface check out Firebug Lite for Chrome.
IE9/10 ... hit F12 for developer tools, they have debug capacity.
IE8 (don't know, I never bother checking against it)
IE7 you'll need to download the developer tools from Microsoft.