Using below javascript function you can get file name from path:
function GetFileName()
{
var fullPath = 'http://kapilgbaheti.blogspot.in/2012/08/get-file-name-from-path.html';
var filename = fullPath.replace(/^.*[\\\/]/, '');
alert(filename);
}
You output will be : get-file-name-from-path.html
function GetFileName()
{
var fullPath = 'http://kapilgbaheti.blogspot.in/2012/08/get-file-name-from-path.html';
var filename = fullPath.replace(/^.*[\\\/]/, '');
alert(filename);
}
You output will be : get-file-name-from-path.html
No comments:
Post a Comment