How to pull the file name from a url using javascript/jquery?

var index = yourstring.lastIndexOf("https://stackoverflow.com/") + 1;
var filename = yourstring.substr(index);

Leave a Comment