get file name from url javascript code example
Example 1: get filename from url js
var filename = location.pathname.substr(location.pathname.lastIndexOf("/")+1);
Example 2: javascript get filename from url
var filename = url.split('/').pop();
var filename = location.pathname.substr(location.pathname.lastIndexOf("/")+1);
var filename = url.split('/').pop();