hoy OJO mira los buscadores … mañana los buscadores mirarán OJO
SEO
First Tuesday
OJO
1 de Abril de 2006

Es muy probable que te hayas planteado alguna vez poner emoticonos en Blogger, pero te gustaría que lo hiciera de forma automática. En Free BlogSpot Templates nos dan la solución.

Hay que seguir tres pasos muy sencillos:

Por un lado, has de copiar en el “head tag” lo siguiente:

<!--BloggerEmoticons-->
<script type="text/javascript">
<!--
function replaceText() {
if(!document.getElementById) {
return;
}
bodyText = document.getElementById("body");
theText = bodyText.innerHTML;
theText = theText.replace(/;\)/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/wink.gif" alt=";)" />');
theText = theText.replace(/;-\)/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/wink.gif" alt=";-)" />');
theText = theText.replace(/:D/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/biggrin.gif" alt=":D" />');
theText = theText.replace(/:-D/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/biggrin.gif" alt=":-D" />');
theText = theText.replace(/B\)/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/cool.gif" alt="B)" />');
theText = theText.replace(/B-\)/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/cool.gif" alt="B-)" />');
theText = theText.replace(/:x/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/mad.gif" alt=":x" />');
theText = theText.replace(/:X/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/mad.gif" alt=":X" />');
theText = theText.replace(/:-x/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/mad.gif" alt=":-x" />');
theText = theText.replace(/:-X/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/mad.gif" alt=":-X" />');
theText = theText.replace(/:-\(/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/sad.gif" alt=":-(" />');
theText = theText.replace(/:\(/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/sad.gif" alt=":(" />');
theText = theText.replace(/:o/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/ohmy.gif" alt=":o" />');
theText = theText.replace(/:O/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/ohmy.gif" alt=":O" />');
theText = theText.replace(/:-o/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/ohmy.gif" alt=":-o" />');
theText = theText.replace(/:-O/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/ohmy.gif" alt=":-O" />');
theText = theText.replace(/:p/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/tongue.gif" alt=":p" />');
theText = theText.replace(/:-p/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/tongue.gif" alt=":-p" />');
theText = theText.replace(/:-P/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/tongue.gif" alt=":-P" />');
theText = theText.replace(/:P/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/tongue.gif" alt=":P" />');
theText = theText.replace(/:-\)/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/smile.gif" alt=":-)" />');
theText = theText.replace(/:\)/g,'<img src="http://photos1.blogger.com/blogger/7678/802/1600/smile.gif" alt=":)" />');
bodyText.innerHTML = theText;
}
-->
</script>
<!--BloggerEmoticons-->

Una vez añadido esto, has de cambiar en el “body tag” lo siguiente:

<body id="body" onload="replaceText();">

De esta forma, cuando se cargue la página, los diferentes símbolos, cambiarán por las imágenes:

wink biggrin cool mad sad ohmy tongue smile

3 comentarios »
  1. Loriot ha dicho el 2 de Abril de 2006

    Hey, muy buenos los emoticonos. ¿Son creación propia?

  2. eugenia ha dicho el 17 de Mayo de 2006

    a mi no me funciono, creo q deberias explicar mas el post para quienes no sabemos de diseño web

  3. petete ha dicho el 16 de Septiembre de 2006

    Vale, se explican los dos primeros pasos, ¿y cual es el tercero?

    Me parece a mi que los de ojoBuscador escribís las entradas con demasiada rápidez. A ver si en vez de escribir mucho os preocupais mas por escribir mejor, explicando mejor las cosas.