I've got a piece of javascript that dynamically calls an image URL
if (searchResult['image'] != undefined) {
if (searchResult['link'] != undefined) {
searchResultNode += '<a class="image" href="' + searchResult['link'] + '">';
}
searchResultNode += '<img src="' + searchResult['image'] + '" class="ss360-search-result-image" />';
if (searchResult['link'] != undefined) {
searchResultNode += '</a>';
}
}
What function can I write to edit the img src URL so that it removes the file name suffix (.png, .jpg, .jpeg), adds '-764x375' to the URL, and then readds the filename suffix?