Reformatting JavaScript / JScript code?

I have a JScript error on my page. I know where the error is happening, but I'm trying to decode the JScript on this page (to figure out where it came from - it's on the ASPX page, so any number of custom controls could inject it).

It would be easier if it was indented correctly. Are there free JScript reformers for Windows?

+1


source to share


4 answers


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



+2


source


You can use Aptana Studio , free and very good, and you can customize the formatting options .



+2


source


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

Tools like phpDesigner (free trial available) have a code enhancer that will run in JavaScript, but nothing beats the good old TAB key (and a shift to remove unwanted indentation): P

+1


source


Use Visual Studio 2008

  • Create a new web form
  • Paste your js code into source
  • select-all ( ctrl + a

    )
  • right click to open the context menu
  • Click Select Format

Then js and html will be formatted accordingly

+1


source







All Articles