Skip to content

Instantly share code, notes, and snippets.

@lukephills
Last active August 29, 2015 14:24
Show Gist options
  • Save lukephills/fb73b83bf8a4d6c91ae7 to your computer and use it in GitHub Desktop.
Save lukephills/fb73b83bf8a4d6c91ae7 to your computer and use it in GitHub Desktop.
Change all images on local site to point to the remote site
function updateImages(localUrl, remoteUrl) {
var imgs = document.getElementsByTagName('img')
for (i = 0; i<imgs.length; i++) {
imgs[i].src = imgs[i].src.replace(localUrl, remoteUrl)
}
}
updateImages('http://www.kollektivgallery.dev', 'http://www.kollektivgallery.com')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment