View Full Version : subdomain and local links problem

12-25-2007, 11:20 PM
Hey all i am having some weird issues with a site of mine being in a sub domain vs a regular directory.

When i have a page called reg.asp on the regular directory of the server (http://www.blah.com/blah/reg.asp) it works just fine. However, if i put that same file in a sub domain that I've made (http://sub.blah.com/blah/reg.asp) it doesn't load any java or css for the page as it did with the regular directory one.

Here is the javacode:

<script type="text/javascript" src="file:///C|/blah/mootools.js"></script>

Like i said, it works just fine on the regular dirctory but doesn't in the sub domain.

Any help would be great! :)

12-25-2007, 11:53 PM
Java is not JavaScript (and vice versa).
Notice anything weird with your file path? How about removing everything before the root slash (so it looks like /blah/mootools.js)?

12-26-2007, 12:11 AM
The path is fine, like i said it worked in the regular directory. The javascript is on the computer itself so that is why the path is like that. Its viewed using FF.

My bad, javascript.


12-26-2007, 12:19 AM
Yeah, 'cause I really think that the way of addressing my drives is a letter and a vertical pipe :D

Look again.

12-26-2007, 12:47 AM
The javascript is on the computer itself so that is why the path is like that.

You were talking about a sub domain so… I assumed you’re having that file on a server. I’d really suggest you use relative paths there or a server/domain-independent absolute path because really, that local file path is or will be causing more trouble than it needs to be.

So, change the path to either blah/mootools.js (relative path) or /blah/mootools.js (absolute path without specifying a domain/server) and it should work locally and on a remote server without ever having to change it.

The relative path setting assumes that the JS file is one level below the file calling it (i.e. the /blah directory and the current file with the script link have to be on the same level/in the same directory). The absolute path setting assumes your file in a /blah directory in the server/site root.

12-26-2007, 12:54 AM
the javascript wont be hosted on the server, just the computer. Its for a kiosk so the files will be on there for it to bring up. I just dont understand why it would work using the regular directory vs the sub domain one...


12-26-2007, 01:22 AM
Mayhaps, you have set the regular domain as a trusted site and the subdomain is not set the same way.

12-26-2007, 01:36 AM
Already put it in my list, still nothing... :(


12-26-2007, 03:51 PM
Look, a file path for Windows using a C drive begins C:\, not C|\, as you've put here:

... file:///C|/blah/mootools ...