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

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -