così:

codice:
var str="http://www.dominio.it/prova/test/demo/img1.jpg";
str=str.substr(str.lastIndexOf('/')+1);
ciao