I'm currently developing a SharePoint 2013 Content Search Web Part. In the template, it extracts an image value in this manner:
var cswpiconURL = $getItemValue(ctx, "Announcement Image");
It returns an example image like this:
<img alt="" src="https://i4e7sptest.energyplaza.com/Style%20Library/Client/img/2014-09-6-Life-of-Pix-free-stock-photos-sunset-flares-summer-railway-Julien-Sister.jpg" width="498" style="BORDER: 0px solid; ">
I am attempting to create another variable below cswpiconURL that only captures the src from the image. Here is what I currently have, but it doesn't seem to be functioning.
var cswpiconURL = $getItemValue(ctx, "Announcement Image");
var cswpiconURLsrc = cswpiconURL.src;