Przerobiłem tak by móc z tego kodu korzystać. Na przykładzie w html, podmieniłem ten kod i działał. Przykład wygląda następująco:
<html> <head> <script type="text/javascript"> $(document).ready(function(){ $(".posted").emoticons(); }); </script> <style type="text/css" media=screen> <!-- .emoticonimg{ /*border: 1px solid #000000;*/ vertical-align:bottom; } --> </style> </head> <body> <div class="posted"> I think you are a (M). This content is inside a div. </div> :-) :) =] =) :-( =( :[ :< ;-) ;) ;] *) :D =D XD BD 8D xD :O =O :-O =-O (6) (A) :'( :'-( :| :o) 8) 8-) (K) :-* (M)<br /> They can even be together, no need of whitespaces inbetween: :)(M) </p> :-) :) =] =) :-( =( :[ :< ;-) ;) ;] *) :D =D XD BD 8D xD :O =O :-O =-O (6) (A) :'( :'-( :| :o) 8) 8-) (K) :-* (M)<br /> They can even be together, no need of whitespaces inbetween: :)(M) </p> <ol class="posted"> </ol> <form> The following button is an input of type submit, which does not hold any html inside, so even if we says it is of class posted, we are not doing any harm. <input type="submit" value="Hi:)" class="posted" /> </form> Bug B0001 is caused due to the simple(naive) replacement method. There should be a traversal of the DOM or a regular expression replacement in order to get better results, but that would be rather slow. See the source code to understand the problem. <ul> </ul> </body> </html>
Po czym dodałem do swojej strony kod. I o dziwo nie działa. A oto on:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <head> <script type="text/javascript" src="jq.js"></script> <script type="text/javascript" src="jquery.emoticons.js"></script> <script src="js/chat_limit.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $(".posted").emoticons(); }); </script> </head> <div style="height: 100%; width: 100%; background-color: #fff"><iframe name="ramka" style="height: 90%" id="NEWSY" src="chat_include.php"></iframe> <form name="formularz" action="chat_send.php" method="post"> <input onkeyup="SignLimit(this,250);" id="tresc" type="textarea" class="text" name="tresc" style="width: 98.5%" placeholder="Treść postu..."> <p class="center" style="margin-left: 10px"><table border="0" bordercolor="" style="background-color:" width="98.5%" cellpadding="0" cellspacing="0" style="margin-left: 10px;"> <tr> <td align="left"> <a onclick="document.getElementById('tresc').value+='^^'"> <img src="emotes/^^.gif" style="border:0px;" /> </a> <a onclick="document.getElementById('tresc').value+=':('"> <img src="emotes/=(.gif" style="border:0px;" /> </a> <a onclick="document.getElementById('tresc').value+=':)'"> <img src="emotes/=).gif" style="border:0px;" /> </a> <a onclick="document.getElementById('tresc').value+=':D'"> <img src="emotes/=D.gif" style="border:0px;" /> </a> <a onclick="document.getElementById('tresc').value+=':P'"> <img src="emotes/=P.gif" style="border:0px;" /> </a> <a onclick="document.getElementById('tresc').value+=':]'"> <img src="emotes/evil_smile.gif" style="border:0px;" /> </a> <a onclick="document.getElementById('tresc').value+=':>'"> <img src="emotes/have_a_nice_day.gif" style="border:0px;" /> </a> <a onclick="document.getElementById('tresc').value+='o.o'"> <img src="emotes/O.o.gif" style="border:0px;" /> </a> <a onclick="document.getElementById('tresc').value+=':O'"> <img src="emotes/oh_noes.gif" style="border:0px;" /> </a> <a onclick="document.getElementById('tresc').value+=':{'"> <img src="emotes/owie.gif" style="border:0px;" /> </a> <a onclick="document.getElementById('tresc').value+=':/'"> <img src="emotes/serious.gif" style="border:0px;" /> </a> <a onclick="document.getElementById('tresc').value+=':c'"> <img src="emotes/shame.gif" style="border:0px;" /> </a> <a onclick="document.getElementById('tresc').value+='T.T'"> <img src="emotes/T.T.gif" style="border:0px;" /> </a> <a onclick="document.getElementById('tresc').value+='WTF'"> <img src="emotes/WTF.gif" style="border:0px;" /> </a> <a onclick="document.getElementById('tresc').value+='xD'"> <img src="emotes/XD.gif" style="border:0px;" /> </a> </td> <td align="right"><span><form><input class="posted" type="checkbox" value="refresh" id="refresh"></form> <p class="posted">XD</p></span> <span id="counter">0/250</span> <button class="button default">Wyślij</button></td> </tr> </table></p> </form> </div> <script language="java_script" type="text/java_script"> <!-- function licz() { document.form.text.value = document.form.poletekstowe.value.length } //--> </script>
I co ja robię nie ta, że u mnie nie działa, na na przykładzie i owszem?