TIP 222: Stripping Extra Code


GoLive offers very powerful authoring tools that can save you a lot of development time, but sometimes the tradeoff is a little bit of extra source code. For example, if you use templates, some extra comment tags are inserted in the source code, and if you want your source code formatted nicely, some extra space characters are added.

Automatically Flattening the JavaScript Library

Check this option to optimize the site-wide JavaScript library (GeneratedItems/ CSScriptLib.js) every time you upload files from your site. When the library is flattened, it only uses the functions necessary for your site and will optimize overall download time of your site (see Tip 187).


If you're really picky about your source code or need it to validate perfectly against certain standards, GoLive can strip out these extra tidbits and upload the most pristine code you've ever seen. To enable code stripping, choose Site > Settings and select the Upload/Export pane on the left. Enable the Site Specific Settings checkbox at the top of the dialog and look at the Cleanups section (Figure 222). You can tell GoLive to strip the following code every time you upload or export your site.

  • Adobe GoLive Elements: Special tags for features such as JavaScript Actions and Components.

  • Comments: Any source code comments including those used to manage templates.

  • Spaces: Any extra spaces for formatting your source code.

Figure 222. Enable code stripping in the Site Settings dialog to control the final output.


Stripping extra code doesn't affect how the pages work in a Web browser, but removing spaces does reduce the readability of the code. If you strip GoLive elements, it will be all but impossible to easily re-edit advanced GoLive features such as components and JavaScript Actions.



    Adobe GoLive CS2 Tips and Tricks The 250 Best
    Adobe GoLive CS2 Tips and Tricks The 250 Best
    ISBN: B008CMGJS0
    EAN: N/A
    Year: 2005
    Pages: 301

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net