visual studio 2008 allows c# code to be segregated into regions is there an equivalent for开发者_StackOverflow中文版 javascript?
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.
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. how to implement regions/code collapse in javascript
Alternatively you can collapse custom code sections in Dreamweaver, might be worth editing your JavaScript using that instead
精彩评论