Javascript basename() and dirname() In: Code, Javascript, PHP 3 blablas On: 2008 / 04 / 27 Shorter URL for this post: http://ozh.in/i0 For my next stuff I needed the Javascript equivalents of PHP functions basename() and dirname(). Nothing genius: < View plain text > javascript function basename(path) { return path.replace(/\\/g,'/').replace( /.*\//, '' ); } function dirname(path) { return path.re

