/ Published in: JavaScript
* example: google.com/reader/view/
folder = /reader
* example: google.com/reader
folder = /
* example: google.com
folder = ''
folder = /reader
* example: google.com/reader
folder = /
* example: google.com
folder = ''
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var folder = window.location.pathname.substring(window.location.pathname.indexOf('/', 0), window.location.pathname.indexOf('/', 1));