SharePoint Online – Get Image from publishing site list – JavaScript & Regex

Dynamics CRM – Attach attachment to email without saving the file to a server / 0 sized byte array / empty files
November 21, 2019

SharePoint Online – Get Image from publishing site list – JavaScript & Regex

Walked into an interesting SharePoint online environment where a mixture of different configurations were being used depending on who asked for what. One of these features was using a publishing site to handle news item.. Now, trying to actually retrieve some of the image URIs are a pain, so hacked together the following using a browser console to pull the image out of a specific item.

All of this can be simplified and used elsewhere.. I just wanted to see if I could pull the information out.

Result[0] = “src=”/sites/…Picture%20Library/cats.jpg””
Result[1] = “/sites/…/Picture%20Library/cats.jpg”

Jason
Jason
I do things in the clloouuudddd