有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

ajax如何在java聊天应用程序中添加笑脸功能?

在我的聊天应用程序中,我需要添加笑脸功能吗?我怎样才能做到这一点

我们正在使用“Genesys”创建聊天应用程序

可以添加笑脸吗

请任何人都能帮助我

先谢谢你


共 (1) 个答案

  1. # 1 楼答案

    你可以这样做Pure CSS/JS Emoticons

    可以用图像替换文本

    查看示例、源代码和此jsFiddle Demonstration

    样本

    var emoticons = {
      smile: '<img src="path/smile.gif" />',
      sad: '<img src="path/sad.gif" />',
      wink: '<img src="path/wink.gif" />'
    };
    
    var patterns = {
      smile: /:-\)/gm,
      sad: /:-\(/gm,
      wink: /;-\)/gm
    };
    
    $(document).ready(function() {
      $('p').each(function() {
    
      var $p = $(this);
      var html = $p.html();
    
      $p.html(html.replace(patterns.smile, emoticons.smile).
      replace(patterns.sad, emoticons.sad).
      replace(patterns.wink, emoticons.wink));  
     });
    });
    

    更多信息