вот так
function FindReplace (word, img) {
var elements = document.body.getElementsByTagName('*');
var element, html, i = 0, tagN;
var regE = new RegExp (word,'ig');
var leng = elements.length;
(function closing() {
element = elements[i];
tagN = element.tagName.toLowerCase();
if ( tagN == 'script' || tagN == 'style')end();
html = element.innerHTML;
if( html.search(regE)== -1) end();
element.innerHTML = html.replace(regE,img);
function end () {
if (i > leng-1) return;
console.log(i > leng-1)
i++;
setTimeout(closing,0);
}
end();
}());
}
FindReplace('lol','<img src="http://ctrlc.ru/wp-content/uploads/2012/06/18.jpg" >')