473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

relative path wooes

realin
254 100+
hi guys...
its just a simple thing but confusing me like hell.. i donn know why /.

i just want to know how do i set relative paths, lil information can help you :-

my hosting is on linux

what i know is :-

../ would jump level up from the current directory


so here is the directory structure..

i have folders

inc
script
style


so my script file is in "inc" which wants to access a JS file from "script" folderso how do i do it

src="../script/file.js";
or
src=../../script/file.js";

well none of them worked for me..

also my current operating system is WINDOWS, so i will have to change these paths again for my windows or what ?

thanks for ur time :)
Aug 7 '07 #1
4 1247
nathj
938 Expert 512MB
The first thing that comes to my mind, from my own experience, is that linux is case sensitive. So a file name of 'javafunctions.js' is not the same as a file name of 'JavaFunctions.js'

It sounds really obvious I know, but it's worth mentioing.

Cheers
nathj
Aug 7 '07 #2
realin
254 100+
The first thing that comes to my mind, from my own experience, is that linux is case sensitive. So a file name of 'javafunctions.js' is not the same as a file name of 'JavaFunctions.js'

It sounds really obvious I know, but it's worth mentioing.

Cheers
nathj

thanks a lot for the quick reply, but that is not the case, still i have checked it thoroughly.. I am missing something.. but for instance take this

my css file is lying in root and all the images are lying in img folder so when i write background-image:url(./img/main2.jpg); then it works quite fine.. but not with the javascript or other files like .txt
Aug 7 '07 #3
realin
254 100+
oh my ghosh!! i got it myself only where the problem is

actually the file which exists in inc folder is a function which gets called by a file in teh root, now i was setting path in relative to inc folder but it was suppose to be set for the root..

moderator if wants can delete this thread, but it is useful for the n00bs like me :D
Aug 7 '07 #4
nathj
938 Expert 512MB
thanks a lot for the quick reply, but that is not the case, still i have checked it thoroughly.. I am missing something.. but for instance take this

my css file is lying in root and all the images are lying in img folder so when i write background-image:url(./img/main2.jpg); then it works quite fine.. but not with the javascript or other files like .txt
Ok, well it was worth a try.

What happens if you use the absolute path instead? Does that get things working properly for you?

Cheers
nathj

EDIT: The answer (post below) must have been posted while I was typing this oh well. Glad the problem has been solved.
Aug 7 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Doug | last post by:
If I were to write an include with a relative path like include("../conf/config.php"); What is the use? As far as I understand it, the path is relative to the first script that is called by...
5
by: jason | last post by:
Can anyone help me find a solution to quickly working out relative paths to a folder in the root of my server... Although it easy when you go - say - two levels down: .../includes it...
7
by: Rizaan Jappie | last post by:
is it possible to get the relative path based on a absolute path in c#? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
6
by: openleren | last post by:
Hi all, how can I use a relative path in my web.config file for an Access db?: Instead of using <configuration> <appSettings> <add key="conAccess" value="microsoft.jet.oledb.4.0;data...
4
by: Win, Pats | last post by:
I have a snippet of HTML that I inject into a number of pages throughout my Web site at runtime. My problem is that I'm not getting the image to appear in all documents into which this snippet is...
18
by: Nak | last post by:
Hi there, Does anyone know what path the AssemblyKeyFile attribute is relative to? For example I currently have mine set to <Assembly: AssemblyKeyFile("..\NicksKey.snk")> Sometimes this...
8
by: JJ | last post by:
I'm confused about paths. I have a functionn that uses the mappath method, which I think requires a virtual path (is that the same as a relative path?). But this doesn't always work as the...
15
by: Lars Eighner | last post by:
Aside from the deaths of a few extra electrons to spell out the whole root relative path, is there any down side? It seems to me that theoretically it shouldn't make any difference, and it would...
0
by: Gabriel Genellina | last post by:
En Sat, 18 Oct 2008 05:52:04 -0300, Stef Mientki <stef.mientki@gmail.com> escribió: Why don't you let the caller tell you its own location, using __file__? The above code is too much magic for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.