Well I think this is kinda simple thing but its messing me up,
Well I have a javascript file in the base directory…. for example.
abcmyjavascript.js
and I have five directories in the base directory. for example
abcxy
abcab
abcmno
abcyz
abcrs
I have files with names 1.html, 2.html…. 12.html…114.html…
All files are marked with number and there are also files in triple digits
All the five directories
xy
ab
mno
yz
rs
have the files 1.html…..444.html…. but with different versions.
i have a drop down menu in all the files in all the directories.
suppose, from the page of
abcxy3.html
if I choose mn version (from the list) the file to be loaded should be
abcmno3.html
Now I am almost done with the javascript but the problem thats is happeneing is,
when I choose mno version from
abcxy3.html
the file loading is
abcxymno3.html
where I want
abcmno3.html
I am using this script for that
[COLOR=red]var url = “mno/” + fileName ;
document.location.href = url;
What should I do? use substring to get the current location using [COLOR=red]document.location;
or is there any way to go down the directory tree from javascript?
and if i should use the substring, can anyone give me the syntax?
Also, I have problems finding the file name, as the file names differ in size… in the same directory the file names are from 1.html to 444.html how can I use substring function to get only the file name, either 1.html or or 23.html or 444.html
Thanks.