• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

locating a file

 
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have a directory structure similar to:

PROJECT FOLDER (proj)

pages scripts styles

where pages contains html files, scripts contains .js files, and .css
files in styles folder.

If myStyles.css is a file in styles folder,
and XXX.html is a file in pages folder.

I'm trying to use myStyles.css inside of XXX.html.
I cannot see why using the absolute path:

does not work.

However the following two options do work, but I'm not keen on the latter.


Can anyone explain whats wrong with "/styles/myStyles.css", and
what is the best approah here.

Thanks very much
[ March 09, 2006: Message edited by: colin shuker ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the app root is proj, why would you expect it to work if you don't provide it?
 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well I recently passed the SCWCD exam, and when referring to an html page outside of web-inf, I just used a /, then the pages name. Not the full path name.
See what I mean?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
/styles/myStyles.css looks for a folder named styles inside the current directoy.

Eric
 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But for scripts you need the full path name?
Eg proj/scripts/external.js
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You really need to read this: http://www.webreference.com/html/tutorial2/3.html

Eric
reply
    Bookmark Topic Watch Topic
  • New Topic