var url = "http://some.ru/folder/file.exist"; var fileName = url.substr(url.lastIndexOf("/") + 1); alert(fileName);