Сообщение от mooni
|
http://akv.myqip.ru/?1-1-0-00000000-000-0-0
|
mooni,
function FindClass(FindClas){
var allTag, allElem, arrE = [], i;
if(document.getElementsByClassName){
return document.getElementsByClassName(FindClas);
}
allElem = document.body.getElementsByTagName('*');
i = allElem.length;
while(i--){
if(allElem[i].className == FindClas) arrE.push(allElem[i]);
}
return arrE;
}
function FindReplace (word, img) {
var elements = FindClass('font1');
var element, html, i = 0;
word= word.replace(/([\[\]])/g,'\\$1');
var regE = new RegExp (word,'ig');
var leng = elements.length;
(function closing() {
element = elements[i]
html = element.innerHTML;
if( html.search(regE)== -1){
end();
return;
}
console.log(html.replace(regE,img))
element.innerHTML = html.replace(regE,img);
function end () {
if (i > leng-1) return;
console.log(i > leng-1)
i++;
setTimeout(closing,0);
}
end();
}());
}
FindReplace('[tab]',' <img src="http://i294.photobucket.com/albums/mm119/lazarncane/1.gif" > ')
alert('hi');
</script>