Thread: Java Help
Results 1 to 2 of 2
01-23-2010, 12:45 PM #1
Im using an ecommerce system called EKM Powershop.
What I need help with is, I want to create an editable element, but I need the name to change depending on the path they are on the website.
But as I edit the website in my ekm powershop the path for the editable element is
I have some code working that pulls the path and splits it up, but I want to display the last path only
so if i was on
it would display - PATH
and if i was on
it would display PATH
the code I have at the moment is
but what this does is write in the 1st path, but as it changes depending on what part of the shop i am i need to change it.
I either need to find the length of the array and the show the last part of the array only
show the last part of the path
if anyone nows how to do this would be awsome
Last edited by HTML; 01-23-2010 at 06:35 PM.
01-23-2010, 04:22 PM #2
Re: Java Help
Fixed it now heres the code if anybody needs to use it
pathArray = window.location.pathname.split( '/' );
subdirectory=pathArray[testvalue - 1];
what this does is automatically pulls the last path of the URL so for example if the url was
it would take path4 out and you can use that as you wish.