views:

49

answers:

3

Hi, I'm using ASP.Net and whenever I create a script file or try to include a script file like jQuery they aren't working. I am doing just a regular localhost server and none of the scripts are working. Upon further examination using firebug I look at whats being referenced in those scripts and it shows html code for a 404 error. I know the scripts and files are there and I can navigate directly to them in the browser but for some reason I can't reference them in my page.

Here is a screenshot:

404 Error

alt text

+3  A: 

My bet is that the relative reference to the script:

../script/jquery-1.4.2-min.js

breaks because your current page is in a directory where it won't work. (maybe caused by a rewritten URL).

Can you show

  • What URL you are on
  • What absolute directory the scripts reside in?
Pekka
URL: http://localhost:49464/Seth-Duncan.com/Main.aspxDirectory structure: See Above Second Image
Seth Duncan
A: 

The path to the scripts file is wrong - there is ".." in it. You should specify path on the server, not on the file system.

Andrew Bezzub
There's nothing wrong about specifying a relative path in a web server with ".."The only problem is that the files must be at that location as Pekka said.
AlfonsoML
I see, thanks. For some reason I though that Seth Duncan used file system path.
Andrew Bezzub
+1  A: 

The problem is rather straightforward to me.

The webpage: http://localhost:49464/Seth-Duncan.com/Main.aspx
The jquery: http://localhost:49464/scripts/jquery-1.4.2-min.js

Unsurprisingly, there doesn't seem to be a jquery script there. Most likely, it would work fine on the production server.

Spin City
I don't think it's quite that simple, I say this because I reference the stylesheet in the exact same manner and it references fine, it's just the scripts in the script folder
Seth Duncan
Correction, it was that simple, I changed it to not use the Seth-Duncan.com/ folder name and just use root and it all works fine. Thanks
Seth Duncan