views:

53

answers:

2

Hello guys,

I have a website which has so many sub folders in it. I have following paths references to my js and css files.

    <link rel="stylesheet" type="text/css" href="css/styles.css" />
 <script type="text/javascript" src="js/jquery.js"></script>

the above code is working fine on my local machine. the JS file is not loading when i host the website into production server. Problem in my hosting server is my website is ponted to

www.somewebsitename.com

instead

www.somewebsitename.com/home.aspx

. When I load the page with www.somewebsitename.com/home.aspx this url it is loading all the js files it is not loading files only when I load the page with www.somewebsitename.com.

Please solve my problem. How to reference JS files so that they ll loaded how ever u visit the page.

+1  A: 

Have you tried putting a leading slash in front of the paths, so that they are relative to the root folder instead of relative to the HTML folder?

bwarner
+2  A: 
Michael
Not sure why it didn't display the paths in my examples. This site is a little odd with formatting sometimes eh?
Michael