Back Ground Information
I am working with SharePoint and Office.Js add in which I am creating. The project owner would like images to be inserted along with text on the fly, however all I am getting the string that I am getting back from my ajax call to SharePoint only brings the URL within in the img tag. This is a string which I am tokenizing by using
for (var x = 0; x < imageToInsert.length; x++) {
seetest = imageToInsert[x].search("<img");
if (seetest >= 0)
{
cleanedB64 = imageToInsert[x].toString().replace('~~end~~', '');
imageB64.push(cleanedB64);
}
}
var teststop = 0;
}
InsertPlainText(s
Question
Working on a project that will need to get the "url" from with in a html img tag that I am receiving from SharePoint. Currently I have an expression which is only catching the < img part of the string but I am not getting the actual URL. The expression I am using is /img src=([^]*?)
but all I am getting is "img src=" from the string <img src="/sites/ContentCenter/Graphics/map-al.jpg" alt="map al" style="width:611px;height:262px;" /> <br></p><p><br></p><p>
.
Desired Result:
I am looking to get the url with in a html img tag that I getting back from sharepoint