Thứ Năm, 22 tháng 10, 2015

JQUERY get image full path

Des: get full path image http,domain,subfolder,filename

JQUERY:

var imagefullpath=$('img')[0].src;
alert(imagefullpath);
result: http//domain.com/subfolder/image-name.jpg
-
var imgagepath=$('img').attr('src');
alert(imagepath);
result: subfolder/image-name.jpg