473,399 Members | 2,774 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,399 software developers and data experts.

File Location of files

2
This is probably a very basic problem.

I have created a navigation bar with drop down boxes with Javascript, and put the code in an external file. Some of the pages on the drop down box are in their own folders so when I click on a page in the drop down box from the Home page, it works, but when I am on a page that has its own folder and click to go to another page on the navigation bar it comes up with this link appears to be broken because it is looking at the address that would be correct only if the page is in the root directory and not its own folder. (it adds the folder address twice because it is already in that folder).

So what address can I put for each page location so no matter where each page is sitting, it will work?

Hope that makes sense.
May 8 '10 #1
1 1104
acoder
16,027 Expert Mod 8TB
You can use location.href to work out which folder it's in and make sure the links are correct.
May 9 '10 #2

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

Similar topics

2
by: Kory Postma | last post by:
I would like to know if there is anyway to get the exact file location on a harddrive? For instance, you pass a filename and you can then get the head, track, sector, etc.. of the file (and its...
0
by: R.A. | last post by:
Hi Is there a way to specify the EventLog file location? The application I have is writing to its own event log file but I don't know how can I set the location where this file will be located....
1
by: Jim Heavey | last post by:
Hello, I have done some volunteer work for my club and develop a web site in ASP.Net. I have the code working fine and now I am ready to move the code up to their web hosting company. I have...
5
by: aiki727 via DotNetMonster.com | last post by:
Hello everyone, Where do I store a bitmap or jpeg that I am using for a forms background image when I deploy the application? Or do I link these files to the app during the deployment? Thanks...
2
by: Bill | last post by:
I have an Access 2003 database application that I split into an application component MDB file (i.e., forms, etc) and a data component MDB file (i.e., tables, etc.). I used the 2003 developer...
0
by: sowmiyaraman2000 | last post by:
i have to create a open dialogue box in web application( i have done it in windows application) it should be in such a way that if i click File-> open it should pop up open dialogue box with default...
5
by: evenlater | last post by:
I know how to determine the file location of the current Access database in VBA. But I'm trying to figure out how to determine the file location of my back-end. Anybody know how I can call up the...
4
by: Bob Altman | last post by:
Hi all, When I create a new website (click on "Create: Website" from the start page), I'm prompted for the location of the project files, but VS 2005 always creates a SLN file under the Visual...
2
by: ahmurad | last post by:
Dear Brothers, I am using a 'text file location' at my code to read the file contents- which is working fine in my local server. The web contents/php files and the specified txt file are at the...
4
by: mcare | last post by:
I am trying to load an image file location to a mysql table via php I can type the location into the form but wish to browse for the file then submit into the varchar table.
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.