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?

1

4 Answers 4

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.

Sign up to request clarification or add additional context in comments.

Comments

2

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

Comments

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

2 Comments

Doesn't work for me (in VS2008 Developer). Doesn't work in a .JS file, or in a .ASPX file.
It works in an aspx page...I use it all the time actually It also indents the code when you terminate a line with a ;
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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.