Brandon A
Brandon A

Reputation: 8279

Dreamweaver: Auto-Indent JavaScript code

I am using a template website that I downloaded online. Everything works - problem is all of the JavaScript in my project is unreadable as it is all written as one line. My thought is that downloading it caused all of the spaces and indents in the .js document to go away and everything is left lookinglikethisfortheentirepage. That makes this very unreadable. Does anyone know of a way to auto-indent JS in Dreamweaver?

Upvotes: 1

Views: 3022

Answers (2)

raneshu
raneshu

Reputation: 413

You have a few options:

Commands > Apply Source Formatting
Commands > Clean up HTML

Also, as a third option, try going to www.jsfiddle.net . You can paste you code there and click tidyup.

They work like magic

You can also use the Dreamweaver extension for JavaScript. Find it here

Upvotes: 0

undefined
undefined

Reputation: 4135

paste the code in the javascript beautifier, click beautify and then paste that into dreamweaver.

Hope that helps, happy new year!

Upvotes: 6

Related Questions