I’m stuck on the.replace function.
I have a gallery, previewing thumbnails through this URL standard:
/uploads/admin/mcith/mcith_1157936397041.jpg
I want the URLs to be like this:
/uploads/admin/1157936397041.jpg
removing the mcith/mcith part.
I’ve done a small .replace script and got pretty close, but got stuck with the slashes and underscores.
Here’s what I got:
v = $(this).attr("src").replace(/mcith/g,'');
alert(v);
The alert prints this:
/uploads/admin//_1157936397041.jpg
Any pointers are greatly appreciated! 🙂
Some characters have a special meaning inside those regular expressions. These characters need to be escaped by preceding them with a backslash