views:

127

answers:

3

visual studio 2008 allows c# code to be segregated into regions is there an equivalent for javascript?

+2  A: 

Unfortunately Javascript don't support this. You can do the separation by comments.

/*My Region (Name It)*/
your scripts
/*End Region*/

Or you can see this thread how to do it. http://stackoverflow.com/questions/1921628/how-to-implement-regions-code-collapse-in-javascript

Kronass
A: 

Alternatively you can collapse custom code sections in Dreamweaver, might be worth editing your JavaScript using that instead

Nick Allen - Tungle139
+2  A: 

There is a way to do this in VS2008: highlight the section of code you want to collapse, then press the Ctrl-M+H chord.

I use this quite a bit when editing javascript files, but unfortunately it isn't permanent - the javascript code will be back to its regular self if you close and reopen the file. I've had js files open for weeks at a time in the editor in the past, simply to avoid losing all my carefully crafted collapsible regions.

slugster