For example I\'ve got the simple code:
var files = $('a[href]').map(function() {
return this.pathname.match(/[^\/]*$/)[0];
});
a[href]
will exclude anchors without hrefs (such as named anchors), and pathname will remove query strings and fragments (?query=string and #fragment).
After this, files
will contain an array of filenames: ['file01.pdf', 'file02.pdf']
.