Return to Snippet

Revision: 40712
at February 5, 2011 18:26 by markux


Initial Code
var folder = window.location.pathname.substring(window.location.pathname.indexOf('/', 0), window.location.pathname.indexOf('/', 1));

Initial URL


Initial Description
* example: google.com/reader/view/

folder = /reader

* example: google.com/reader

folder = /

* example: google.com

folder = ''

Initial Title
Extract folder from window.location.pathname

Initial Tags
url, path

Initial Language
JavaScript