1

i try to get a path from a scriptfile for using inside the script themself but without the final filename.

For Example:

http://www.domain.com/folder/

all my trieing with "window.location" dont work, at my tests, i get "http://www.domain.com" or "final_filename.php"

How can i get the path without the last final_filename with all subfolders in the fastes way?

newbieRB
  • 137
  • 1
  • 14

1 Answers1

0
var pathParts = window.location.pathname.split('/');
var path = window.location.pathname.replace(pathParts[pathParts.length-1],'');