Did you try the swiss army knife of paths the single dot :)?

        e.g.

        src = "./js/dojo/dojo.js"


        --- Pat

> -----Original Message-----
> From: Paul Cantrell [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 14, 2005 11:19 AM
> To: Tapestry users
> Subject: How to include Javascript with correct absolute path?
> 
> I'm trying to use Tacos, and have run into the problem of including
> dojo.
> 
> Tacos recommends I include dojo like this:
> 
>      <script type="text/javascript" src="js/dojo/dojo.js"></script>
> 
> The trick is that my pages have a custom URL structure involving
> slashes, so that the path for a page might look like this:
> 
>      /myapp/article/6738
> 
> ...and instead of looking in /myapp/js/dojo/dojo.js, the browser
> tries to load the script from /myapp/article/js/dojo/dojo.js!
> 
> Of course, I can hard-code the correct full path in my JS include,
> with the initial slash, but that's an awful hack -- there's no reason
> to think that my app will always be deployed as "myapp".
> 
> I don't want to use the Script component (I think...), because it
> would actually inline the whole massive dojo script in my page, and I
> only want clients to have to download it once -- plus, it would only
> push the include path problem back one level, without actually
> solving it.
> 
> Would it work to include the script as an asset, and let Tapestry
> build the correct path for me? If so, how would I do that?
> 
> Should I just write my own ScriptAsset component...?
> 
> Or is there some other solution to this problem?
> 
> Cheers,
> 
> Paul
> 
> _________________________________________________________________
> Piano music podcast: http://inthehands.com
> Other interesting stuff: http://innig.net
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to