javascript - Change part of a string with jQuery -


i'm sure simple, can't figure out.

i have html:

<img src="/7290/9200572193_f95fb66c50_m.jpg" />

which need change

<img src="/7290/9200572193_f95fb66c50_b.jpg" />

this isn't same image, _m.jpg , _b.jpg are. how can jquery?

you can do:

var imgsrc = "/7290/9200572193_f95fb66c50_m.jpg"; imgsrc = imgsrc.replace("_m.jpg", "_b.jpg"); 

Comments

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Java JSoup error fetching URL -

webstorm - PhpStorm file cache conflict with TypeScript compiler -