facebook
twitter
feed

Qué comentan tus amigos

OJO
artículo de publicado el 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://odstatic.com/ojobuscador.com/wink.gif" alt=";)" />');
theText = theText.replace(/;-)/g,'<img src="http://odstatic.com/ojobuscador.com/wink.gif" alt=";-)" />');
theText = theText.replace(/:D/g,'<img src="http://odstatic.com/ojobuscador.com/biggrin.gif" alt=":D" />');
theText = theText.replace(/:-D/g,'<img src="http://odstatic.com/ojobuscador.com/biggrin.gif" alt=":-D" />');
theText = theText.replace(/B)/g,'<img src="http://odstatic.com/ojobuscador.com/cool.gif" alt="B)" />');
theText = theText.replace(/B-)/g,'<img src="http://odstatic.com/ojobuscador.com/cool.gif" alt="B-)" />');
theText = theText.replace(/:x/g,'<img src="http://odstatic.com/ojobuscador.com/mad.gif" alt=":x" />');
theText = theText.replace(/:X/g,'<img src="http://odstatic.com/ojobuscador.com/mad.gif" alt=":X" />');
theText = theText.replace(/:-x/g,'<img src="http://odstatic.com/ojobuscador.com/mad.gif" alt=":-x" />');
theText = theText.replace(/:-X/g,'<img src="http://odstatic.com/ojobuscador.com/mad.gif" alt=":-X" />');
theText = theText.replace(/:-(/g,'<img src="http://odstatic.com/ojobuscador.com/sad.gif" alt=":-(" />');
theText = theText.replace(/:(/g,'<img src="http://odstatic.com/ojobuscador.com/sad.gif" alt=":(" />');
theText = theText.replace(/:o/g,'<img src="http://odstatic.com/ojobuscador.com/ohmy.gif" alt=":o" />');
theText = theText.replace(/:O/g,'<img src="http://odstatic.com/ojobuscador.com/ohmy.gif" alt=":O" />');
theText = theText.replace(/:-o/g,'<img src="http://odstatic.com/ojobuscador.com/ohmy.gif" alt=":-o" />');
theText = theText.replace(/:-O/g,'<img src="http://odstatic.com/ojobuscador.com/ohmy.gif" alt=":-O" />');
theText = theText.replace(/:p/g,'<img src="http://odstatic.com/ojobuscador.com/tongue.gif" alt=":p" />');
theText = theText.replace(/:-p/g,'<img src="http://odstatic.com/ojobuscador.com/tongue.gif" alt=":-p" />');
theText = theText.replace(/:-P/g,'<img src="http://odstatic.com/ojobuscador.com/tongue.gif" alt=":-P" />');
theText = theText.replace(/:P/g,'<img src="http://odstatic.com/ojobuscador.com/tongue.gif" alt=":P" />');
theText = theText.replace(/:-)/g,'<img src="http://odstatic.com/ojobuscador.com/smile.gif" alt=":-)" />');
theText = theText.replace(/:)/g,'<img src="http://odstatic.com/ojobuscador.com/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

  1. el 2 de abril de 2006, Loriot ha dicho...

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

  2. el 17 de mayo de 2006, eugenia ha dicho...

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

  3. el 16 de septiembre de 2006, petete ha dicho...

    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.