/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function getFileName() { var url = document.location.href; url = url.substring(0, (url.indexOf("#") == -1) ? url.length : url.indexOf("#")); url = url.substring(0, (url.indexOf("?") == -1) ? url.length : url.indexOf("?")); url = url.substring(url.lastIndexOf("/") + 1, url.length); return url; }