Get values from string using jquery or javascript -


i have string this:-

var src=url("http://localhost:200/assets/images/eyecatcher/6/black6.png)"

and want image name i.e black6.png , folder name 6. know there substr function can use file name , folder name dynamic orange12.png , 12 etc.

how can these values? please me.

thanks

if base url same do

var url = "http://localhost:200/assets/images/eyecatcher/6/black6.png"; var bits = url.replace("http://localhost:200/assets/images/eyecatcher/", "").split("/"); var folder = bits[0], // 6     file = bits[1];  // black6.png 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -