The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Javascript display current directiory
tk=lm2408
post Feb 7 2017, 05:43 AM
Post #1


Newbie
*

Group: Members
Posts: 19
Joined: 31-January 17
Member No.: 26,289



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:
CODE

var path = document.location.pathname;
var dir = path.substring(path.indexOf('DIRLISTTEST/', 1),
path.lastIndexOf('/'));
document.write(dir);

Can anyone help?
Thank you for your time
Greg
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
tk=lm2408
post Feb 16 2017, 12:31 AM
Post #2


Newbie
*

Group: Members
Posts: 19
Joined: 31-January 17
Member No.: 26,289



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 16 2017, 01:07 AM
Post #3


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,732
Joined: 9-August 06
Member No.: 6



I guess we have to give up. Yeah, please do. These things drive me nuts. blush.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th April 2024 - 06:56 PM