Slashes in file names

T

tshad

David Dorward said:
tshad said:
Nope. You still use "/" here. Any time you use a slash within HTML
code[1], it should be a forward slash.
But that still doesn't find the root directory (at least, I can't seem to
make it work).

It should find the root directory, of course if you are accessing it over
your local file system then the root is c:\ (or whatever drive it is). You
are usually best off installing a local webserver
<http://httpd.apache.org/> for testing if you want to use root relative
URIs.

I am running on my local machine at the moment with IIS on it. View source
gives me:

***************************************************************************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<script language="javascript" src="/includes/ypSlideOutMenus.js"></script>
<script language="javascript">

var menus = [new ypSlideOutMenu("menu1", "down", 220, 112, 190, 300)]

for (var i = 0; i < menus.length; i++) {
menus.onactivate = new Function("document.getElementById('act" + i +
"').className='active';");
menus.ondeactivate = new Function("document.getElementById('act" + i
+ "').className='';");
}
ypSlideOutMenu.writeCSS();
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Home Page</title>
<link href="/css/staffing.css" rel="stylesheet" type="text/css">
</head>
<body>
***************************************************************************
Neither the script line finds the .js file nor the link line finding the
staffing.css.

The URL would be something like http://localhost/development/staff (where
the .aspx file is).

Development is the root (virtual directory) and under that is
css,includes,staff etc.

Tom
 
T

tshad

Dan said:
URLs always use forward slashes. Even "file:" URLs referring to local
system files use forward slashes even though the local operating system
convention might use backslashes.

For relative URLs to the root, you would use
src="/includes/Menus.js".

I tried that (just posted the view source) and it doesn't seem to work.

Here it is again:
**************************************************************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<script language="javascript" src="/includes/ypSlideOutMenus.js"></script>
<script language="javascript">

var menus = [new ypSlideOutMenu("menu1", "down", 220, 112, 190, 300)]
for (var i = 0; i < menus.length; i++) {
menus.onactivate = new Function("document.getElementById('act" + i +
"').className='active';");
menus.ondeactivate = new Function("document.getElementById('act" + i
+ "').className='';");
}
ypSlideOutMenu.writeCSS();
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Home Page</title>
<link href="/css/staffing.css" rel="stylesheet" type="text/css">
</head>
<body>
*******************************************************************

2 lines are set up that way, neither seem to find it:

<script language="javascript" src="/includes/ypSlideOutMenus.js"></script>
and
<link href="/css/staffing.css" rel="stylesheet" type="text/css">

Am I missing something?

Tom
 
T

tshad

tshad said:
David Dorward said:
tshad said:
Nope. You still use "/" here. Any time you use a slash within HTML
code[1], it should be a forward slash.
But that still doesn't find the root directory (at least, I can't seem
to
make it work).

It should find the root directory, of course if you are accessing it over
your local file system then the root is c:\ (or whatever drive it is).
You
are usually best off installing a local webserver
<http://httpd.apache.org/> for testing if you want to use root relative
URIs.

I am running on my local machine at the moment with IIS on it. View
source gives me:

***************************************************************************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<script language="javascript" src="/includes/ypSlideOutMenus.js"></script>
<script language="javascript">

var menus = [new ypSlideOutMenu("menu1", "down", 220, 112, 190, 300)]

for (var i = 0; i < menus.length; i++) {
menus.onactivate = new Function("document.getElementById('act" + i +
"').className='active';");
menus.ondeactivate = new Function("document.getElementById('act" + i
+ "').className='';");
}
ypSlideOutMenu.writeCSS();
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Home Page</title>
<link href="/css/staffing.css" rel="stylesheet" type="text/css">
</head>
<body>
***************************************************************************
Neither the script line finds the .js file nor the link line finding the
staffing.css.

The URL would be something like http://localhost/development/staff (where
the .aspx file is).

Development is the root (virtual directory) and under that is
css,includes,staff etc.


I think I figured it out. Just not sure why.

If I change http://localhost/development/staff to
http://10.0.0.5/development/staff it works fine. For some reason, it has a
problem with localhost.

Tom
 
T

tshad

tshad said:
Dan said:
URLs always use forward slashes. Even "file:" URLs referring to local
system files use forward slashes even though the local operating system
convention might use backslashes.

For relative URLs to the root, you would use
src="/includes/Menus.js".

I tried that (just posted the view source) and it doesn't seem to work.

Here it is again:
**************************************************************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<script language="javascript" src="/includes/ypSlideOutMenus.js"></script>
<script language="javascript">

var menus = [new ypSlideOutMenu("menu1", "down", 220, 112, 190, 300)]
for (var i = 0; i < menus.length; i++) {
menus.onactivate = new Function("document.getElementById('act" + i +
"').className='active';");
menus.ondeactivate = new Function("document.getElementById('act" + i
+ "').className='';");
}
ypSlideOutMenu.writeCSS();
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Home Page</title>
<link href="/css/staffing.css" rel="stylesheet" type="text/css">
</head>
<body>
*******************************************************************

2 lines are set up that way, neither seem to find it:

<script language="javascript" src="/includes/ypSlideOutMenus.js"></script>
and
<link href="/css/staffing.css" rel="stylesheet" type="text/css">

Am I missing something?

I posted this also in my other post:

I think I figured it out. Just not sure why.

If I change http://localhost/development/staff to
http://10.0.0.5/development/staff it works fine. For some reason, it has a
problem with localhost.

Tom
 
T

tshad

tshad said:
tshad said:
David Dorward said:
tshad wrote:

Nope. You still use "/" here. Any time you use a slash within HTML
code[1], it should be a forward slash.

But that still doesn't find the root directory (at least, I can't seem
to
make it work).

It should find the root directory, of course if you are accessing it
over
your local file system then the root is c:\ (or whatever drive it is).
You
are usually best off installing a local webserver
<http://httpd.apache.org/> for testing if you want to use root relative
URIs.

I am running on my local machine at the moment with IIS on it. View
source gives me:

***************************************************************************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<script language="javascript"
src="/includes/ypSlideOutMenus.js"></script>
<script language="javascript">

var menus = [new ypSlideOutMenu("menu1", "down", 220, 112, 190, 300)]

for (var i = 0; i < menus.length; i++) {
menus.onactivate = new Function("document.getElementById('act" + i
+ "').className='active';");
menus.ondeactivate = new Function("document.getElementById('act" +
i + "').className='';");
}
ypSlideOutMenu.writeCSS();
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Home Page</title>
<link href="/css/staffing.css" rel="stylesheet" type="text/css">
</head>
<body>
***************************************************************************
Neither the script line finds the .js file nor the link line finding the
staffing.css.

The URL would be something like http://localhost/development/staff (where
the .aspx file is).

Development is the root (virtual directory) and under that is
css,includes,staff etc.


I think I figured it out. Just not sure why.

If I change http://localhost/development/staff to
http://10.0.0.5/development/staff it works fine. For some reason, it has
a problem with localhost.

My mistake - 10.0.0.5 still didn't work.

Tom
 
T

tshad

tshad said:
tshad said:
Dan said:
tshad wrote:
What about if I want it to be relative to the root folder (not c:,
but the
virtual directory root)?

Something like:

<script language="javascript" src="\includes\Menus.js"></script>

URLs always use forward slashes. Even "file:" URLs referring to local
system files use forward slashes even though the local operating system
convention might use backslashes.

For relative URLs to the root, you would use
src="/includes/Menus.js".

I tried that (just posted the view source) and it doesn't seem to work.

Here it is again:
**************************************************************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<script language="javascript"
src="/includes/ypSlideOutMenus.js"></script>
<script language="javascript">

var menus = [new ypSlideOutMenu("menu1", "down", 220, 112, 190, 300)]
for (var i = 0; i < menus.length; i++) {
menus.onactivate = new Function("document.getElementById('act" + i
+ "').className='active';");
menus.ondeactivate = new Function("document.getElementById('act" +
i + "').className='';");
}
ypSlideOutMenu.writeCSS();
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Home Page</title>
<link href="/css/staffing.css" rel="stylesheet" type="text/css">
</head>
<body>
*******************************************************************

2 lines are set up that way, neither seem to find it:

<script language="javascript"
src="/includes/ypSlideOutMenus.js"></script>
and
<link href="/css/staffing.css" rel="stylesheet" type="text/css">

Am I missing something?

I posted this also in my other post:

I think I figured it out. Just not sure why.

If I change http://localhost/development/staff to
http://10.0.0.5/development/staff it works fine. For some reason, it has
a problem with localhost.

My mistake - 10.0.0.5 still didn't work.

Tom
 
B

Blinky the Shark

Right. I can't tell you how many times I would read out a URL that had a
tilde in it (personal home page or whatever) to someone on the phone and
they would say "not working not working not working" and I'd find out
later that they had actually typed the *word* "tilde" in the URL

Betcha they misspelled it, too.

See above. :)
And I would go over and poke their eyes out and rescind their computer use
privileges and poop on their 5-and-a-quarters[1] and have my cat pee in
their punchcard reader (assuming that they had that particularly advanced

Dammit! Dropped my deck, again...
I/O device) and and then I'd yell at them and tell them that their momma
was a Timex Sinclair and then I'd really get mad and mess them up. yeah.

I had one of those, but it wasn't promiscuous. But that may simply
have been for lack of many ports.
Then I'd put my Apple IIc in their butt sideways and tell them to take it
up with Jef Raskin. Ah...how I loved that IIc.

C? Bleeding edge. I had a ][e.
[1] Don't know what that is? Sheesh.

Who doesn't?
 
T

tshad

David Dorward said:
That is your problem then. You are telling it to look from the root of the
server, not from /development/.

That doesn't seem to be right, as I did try to move the includes folder to
c:/includes and it still didn't work.

But even if it did, the question is how do I tell it to look from the root
(development)?

Tom
 
T

tshad

JDS said:
Problem solved, then. Put "development" in the path in your HTML files.

<script language="javascript"
src="/development/includes/ypSlideOutMenus.js"></script>
So you need to put the root directory name in? I thought that was what the
"/" was for so you could move the folders to a different site (that had a
different root name, but the same folder setup).

Also, this does not seem to work for:

<!-- #include file="/development/includes/development/slidemenus.inc" -->

I get the error:

***************************************************************************************
Parser Error Message: Could not find a part of the path
"C:\development\includes\development\slidemenus.inc".

Source Error:

Line 3: <%@ Register TagPrefix="fts" TAgName="footer"
src="/development/includes/defaultFooters.ascx" %>
Line 4: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
Line 5: <!-- #include
file="/development/includes/development/slidemenus.inc" -->
Line 6: <script runat="server">
Line 7: sub Page_load(s as object,e as eventargs)
******************************************************************************************

Notice the slashes in the error are reversed from my include statement.

Tom.
 
M

Mark Parnell

Previously in alt.html said:
But even if it did, the question is how do I tell it to look from the root
(development)?

But the development directory *isn't* the root folder - it's inside the
root. Otherwise /development would never appear in the URL.
 
J

JDS

Also, this does not seem to work for:

<!-- #include file="/development/includes/development/slidemenus.inc" -->

You are not fully understanding paths or directories.

Questions for you to ask before trying to find a file for inclusion:

1) where is this current file in the filesystem? The full path, including
C: (if you are on windows as you said you are)

2) Where is the file I want to include?

3) Is the file to be included in the SAME directory as the "parent" file?

OR

4) Is it in a subdirectory of the "parent" file's directory?

OR

5) is it in another directory entirely?

If 3 is true, then just include the file, no path at all:

<!-- #include file="/development/includes/development/slidemenus.inc" -->
OR
<script language="javascript" src="ypSlideOutMenus.js"></script>
or
<?php include("filename.php"); ?> // (PHP example)

If (4) is true, do NOT include a starting slash (forwards or backwards)
and just use the subdirectory name, for example:

<!-- #include file="development/slidemenus.inc" -->
OR
<script language="javascript"
src="development/ypSlideOutMenus.js"></script>
OR
<?php include("development/filename.php"); ?> // (PHP example)


If (5) is true, then you should consider using the full path starting with
C: or "/"

still stuck? Read some books.

later...
 
J

JDS

C? Bleeding edge. I had a ][e.

I was 9 when my dad brough home an Apple II+. The plus -- remember this?
-- meant something like 8k RAM instead of the standard 2k (or 4k?). That's
KB! Not MB!! Wow. Pops worked at GWU's Engineering school and my brother
and I would bang on the latest PC's they had -- Apples, that is. (That was
when "PC" was more generic for "Personal Computer" and didn't
specifically mean WintTel/IBM clone.) They had a 5MB external hard drive
for their Apple II's that was about the size of a modern minit-towser PC.
5MB! And that was whoppin' huge in 1980. (or 81, maybe). We played some
cool games on the early early Macs and I remmeber how cool I though the
3.5inch floppies were.


blah blah blah... I could go on, but who would want to hear that?
 
B

Blinky the Shark

JDS said:
C? Bleeding edge. I had a ][e.
I was 9 when my dad brough home an Apple II+. The plus -- remember this?
-- meant something like 8k RAM instead of the standard 2k (or 4k?). That's

The e in my ][e meant, IIRC extra RAM, too. 128KB, I think.

Was the ][/][+ *that* low out of the box? 2-4KB? Yow.
KB! Not MB!! Wow. Pops worked at GWU's Engineering school and my brother
and I would bang on the latest PC's they had -- Apples, that is. (That was
when "PC" was more generic for "Personal Computer" and didn't
specifically mean WintTel/IBM clone.) They had a 5MB external hard drive

Woohoo! That was big.
for their Apple II's that was about the size of a modern minit-towser PC.
5MB! And that was whoppin' huge in 1980. (or 81, maybe). We played some
cool games on the early early Macs and I remmeber how cool I though the
3.5inch floppies were.
blah blah blah... I could go on, but who would want to hear that?

:)
 
R

R2G2

JDS said:
C? Bleeding edge. I had a ][e.
I was 9 when my dad brough home an Apple II+. The plus -- remember this?
-- meant something like 8k RAM instead of the standard 2k (or 4k?). That's

The e in my ][e meant, IIRC extra RAM, too. 128KB, I think.

Was the ][/][+ *that* low out of the box? 2-4KB? Yow.
KB! Not MB!! Wow. Pops worked at GWU's Engineering school and my brother
and I would bang on the latest PC's they had -- Apples, that is. (That was
when "PC" was more generic for "Personal Computer" and didn't
specifically mean WintTel/IBM clone.) They had a 5MB external hard drive

Woohoo! That was big.

Absolutely - I remember upgrading my Atari to 2 MB from half (was a
520 not a 1040 - still makes me smile when I think I could fit severel
times that computer onto 1 CD!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,900
Latest member
Nell636132

Latest Threads

Top