This question is same as How to find the current folder through JS COM? this one. But my problem is I can't get the folder name from the root folder, For instance
final is the root folder in share point. And
final folder contain the several folders. I'm trying to get the folder name from the
I tried with the following script this is copied from the another answer
var currentFolder = decodeURIComponent(ctx.rootFolder).split("/").pop();
This is not giving the folder name from the root folder, but it is working while directory moved into the child folders.
/final #Here folder name is not giving /final/1/ #While moving into child folder name is giving by the above code /final/2/ #,,,