1

I've got a JScript error on my page. I know where the error's happening, but I'm attempting to decipher the JScript on that page (to figure out where it came from -- it's on an ASPX page, so any number of user controls could have injected it).

It'd be easier if it was indented properly. Are there any free JScript reformatters for Windows?

Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380

4 Answers4

2

You really should use Firebug or some similar debugging tool to actually find the problem, but, if you want to just format your JavaScript code, here's a reformatter I found on Google.

Adam Rezich
  • 3,122
  • 6
  • 31
  • 39
2

You can use Aptana Studio, its free and really good, and you can customize your formatting preferences.

Christian C. Salvadó
  • 807,428
  • 183
  • 922
  • 838
1

How about if you just run Firebug, it will tell you what the error is and will take you to where it is.

Tools like phpDesigner (there's a free trial) have a code beautifier that will work on JavaScript, but nothing beats the good old TAB key (and shift tab to remove junk indention) :P

TravisO
  • 9,406
  • 4
  • 36
  • 44
1

Use Visual Studio 2008

  1. Create a new Web-Form
  2. Paste your js code in the source
  3. select-all (ctrl + a)
  4. right click to open the context-menu
  5. Click on Format Selection

The js and html will then be formatted accordingly

Andreas Grech
  • 105,982
  • 98
  • 297
  • 360