I know this is a really basic question and forgive me for even asking but I cannot seem to get it right for the life of me.
I am using JQuery to get the url from one image src and load it into another image src which I have working fine. However I need to replace the 100x75 part of the url with something like 800x600 so it pulls the larger image.
How would I do that?
Here is an example: Say Im grabbing the image source url with jquery and it looks like this: http://example.com/images/Something_cool-100x75.png I need it to look like this: http://example.com/images/Something_cool-800x600.png
jQuery(document).ready(function($) {
// this will pull the image I need
var get_image = $('img.attachment-shop_thumbnail').attr('src');
//this will assign the image I pulled above to where I need it to go but I need to replace the 100x75 in the filename to 800x600
$("#sale_img").attr("src", get_image);
});
So if you provide an answer could you tell me how it works because I will also need to change .png to .jpg on some of them as well.. Just not sure how that