Hi,
I'm trying to list the current directory that the current page is located in.
I have it working except it displays %20 instead of a space in the directory name.
The code I have is:
Add decodeURIComponent() . For example here.
That works great thank you very much Pandy:)
Btw is it possible to remove the slash between the directory names?
Do you want to remove all slashes or only the last one?
All of them if possible.
The other problem I have is it doesn't seem to follow the uppercase/lowercase letters in the parent directory names, Eg. a folder named Foo gets listed as foo in all lowercase.
So If I have a path like:
C:/Foo/Footwo
it displays as:
c:/foo/Footwo
If I have:
C:/Foo/Footwo/Foothree
it displays
c:/foo/Footwo/Foothree
So the first directory shows up as lowercase and the rest of the directories shows up correctly.
Is there an easy way to fix that?
Hi Pandy,
Thank you again for your help. I really appreciate your time and knowledge. The string replace works great.
As for Foo I used that as an example as all Directories give the same result, but I tried it on another computer and it works the way I want, so I think it's something screwy at my end. I'm gonna have a play with it now and see if I can figure out what is going on.
Again thank you so much for your help
Greg
In your examples it was just the first directory that was converted to lower case. Was that a mistake and it's all directories?
Strange anyway. Since case doesn't matter on Windows it isn't totally wacko. But I've always used Windows myself, and I don't think I've encountered this. Does the same thing happen if you bring up a command prompt and do a DIR for example or in Windows Explorer? Just curious.
Hi Pandy,
It is just the first directory that gets listed in lowercase. The rest are fine. I can't work it out. It does this on one pc and if I copy the same code to another pc it works fine??
The first letter in the directory name is upper case from explorer and from command promt
What browser on the affected computer?
Hi Pandy,
It's firefox 51.0.1 32bit on both machines.
I was one version behind but upgraded to the same version as you have. Doesn't happen for me. Does it happen with other browsers too on that machine?
Yeah I just tried IE on that machine and the same thing happens. Haven't really had much time lately to find out what is going on. If I find an answer I'll be sure to post it here.
I guess we have to give up. Yeah, please do. These things drive me nuts.
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)