On Thu, Dec 20, 2007 at 02:11:50PM -0500, John Romkey wrote:
> Two recommendations, assuming the Javascript file isn't meant to be  
> modified at runtime:
> 
> First, use an absolute path to the file in your script tag, ie:  
> <script src='/static/clock.js'> or use $c->uri_for() to compute the  
> path.

An absolute path like that assumes your app will always be deployed at /.

My experience is that every time I think I -can- make that assumption, later
I end up really wishing I could deploy my app to a sub-URL for testing or
similar.

You may not have such bad luck, but I don't like to take that chance these days 
:)

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/

_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to