Javascript 无法在asp.net中附加图像和文本

Javascript 无法在asp.net中附加图像和文本,javascript,jquery,asp.net,jquery-ui,signalr,Javascript,Jquery,Asp.net,Jquery Ui,Signalr,这是我的代码,我想将图像和文本一起追加 代码: $(“.ChatSend”)。单击(函数(){ strChatText=$('.ChatText',$(this.parent()).val(); var receiveText=$('.ausername').html(); 如果(strChatText!=''){ var strGroupName=$(this.parent().attr('groupname'); if(strGroupName!='undefined'&&strGroupN

这是我的代码,我想将图像和文本一起追加

代码:

$(“.ChatSend”)。单击(函数(){
strChatText=$('.ChatText',$(this.parent()).val();
var receiveText=$('.ausername').html();
如果(strChatText!=''){
var strGroupName=$(this.parent().attr('groupname');
if(strGroupName!='undefined'&&strGroupName!==false的类型)
chat.server.send($(“#hdnUserName”).val()+':'+strChatText,$(this.parent().attr('groupname');
//此代码不起作用
**var userphoto=“”;
$('.ChatText',$(this.parent()).find('ul').append(userphoto+strChatText)**
//此代码的结尾不起作用
$('.chatterxt',$(this.parent()).val('');
}
返回false;
});

既然您要附加到
ul

$('.ChatText', $(this).parent()).find('ul').append('<li>'+userphoto + strChatText+'</li>');
$('.ChatText',$(this.parent()).find('ul').append('
  • '+userphoto+strChatText+'
  • ');
    $('.ChatText', $(this).parent()).find('ul').append('<li>'+userphoto + strChatText+'</li>');