js中往textarea添加表情,下面代码哪里错了啊
<scripttype="text/javascript"src="js/jquery-2.0.2.min.js"></script><scripttype="text/...
<script type="text/javascript" src="js/jquery-2.0.2.min.js"></script>
<script type="text/javascript" src="js/jquery.qqFace.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#closebtn").click(function(){$("#chatbox").hide()});
$("#lie li").click(function(){$("#chatbox").show(),$("#talk a").text($(this).children(".friendlist").text())});
})
//聊天表情显示
$(function(){
$('.ctb01').qqFace({
id : 'facebox',
assign: 'talking',
path: 'images/arclist/' //表情存放的路径
});
});
$(".SendData").click(function(){
var str = $("#talking").val();
$("#chat01content").html(replace_em(str));
});
function replace_em(str){
str = str.replace(/\</g,'<');
str = str.replace(/\>/g,'>');
str = str.replace(/\n/g,'<br/>');
str = str.replace(/\[em_([0-9]*)\]/g,'<img src="images/arclist/$1.gif" border="0" />');
return str;
}
</script> 展开
<script type="text/javascript" src="js/jquery.qqFace.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#closebtn").click(function(){$("#chatbox").hide()});
$("#lie li").click(function(){$("#chatbox").show(),$("#talk a").text($(this).children(".friendlist").text())});
})
//聊天表情显示
$(function(){
$('.ctb01').qqFace({
id : 'facebox',
assign: 'talking',
path: 'images/arclist/' //表情存放的路径
});
});
$(".SendData").click(function(){
var str = $("#talking").val();
$("#chat01content").html(replace_em(str));
});
function replace_em(str){
str = str.replace(/\</g,'<');
str = str.replace(/\>/g,'>');
str = str.replace(/\n/g,'<br/>');
str = str.replace(/\[em_([0-9]*)\]/g,'<img src="images/arclist/$1.gif" border="0" />');
return str;
}
</script> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询