Created
November 9, 2011 08:20
-
-
Save LeoDT/1350823 to your computer and use it in GitHub Desktop.
replaceImgSrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function replaceImgSrc(id){ | |
var imgs = document.getElementById(id).getElementsByTagName("img"); | |
for(var i=0;i<img.length;i++){ | |
imgs[i].src = qualifyURL(imgs[i].src); | |
} | |
} | |
function qualifyURL(url){ | |
var img = document.createElement('img'); | |
img.src = url; | |
url = img.src; | |
img.removeAttribute("src"); | |
return url; | |
} | |
replaceSrc("data"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment