Javascript basename and urlencode like PHP Anonymous 9:00 AM function basename(path, suffix) { var b = path; var lastChar = b.charAt(b.length - 1); if (lastChar === ...