现在主要的问题是 我怎么样在我这边文本域中显示表情图片 但是我发送给对方的是特殊的字符 对方是通过解析特殊字符来显示是什么表情图片。function insertsmilie(i)
{    var obj_img=document.createElement("img");   
        obj_img.src="img/"+i+".gif";
        obj_img.unselectable = "on";
        obj_img.contentEditable="false";
   
   document.getElementById('put').appendChild(obj_img); 
     //  document.form1.put.value+=smilieface;
       
}这段代码能够实现在文本域中显示图片 但是发送的时候 怎么把图片转化为特殊字符 是个难题

解决方案 »

  1.   

    在我本地存有表情图片,图片都是在本地的,现在主要问题是 我怎么在我本地输入的文本域中显示图片 但是发送的却是代表图片的特殊字符 <textarea id="put" name="put"  cols="63" rows="5" style="overflow:auto;background-color:#FFFFFF;border:1px;"></textarea>

    <input name="guest" id="guest" type="hidden">
    <input name="agent" id="agent" type="hidden">

      <div style="background-image:url(img/centerbar.gif); height:28px;" align="right">
     <input type="button" value="取消" onclick="close()">
      <input type="button" value="发送" onclick="check()">
                                           

      </div>

      </td>
    <td background="img/centerbar.gif" width="5px">&nbsp;</td>
    <td width="263px">
    <div style="background-image:url(img/siderbar.gif);background-repeat:repeat-x;text-align:left;line-height:100%;"><img src="img/IMSidebarButton.gif"/></div>
    <div class="notice">

    <a href="Javascript:void(0)"><img src="img/[1].gif" onclick="insertsmilie('[1]')" border="0"></a>                        <a href="Javascript:void(0)"><img src="img/[2].gif" onclick="insertsmilie('[2]')" border="0"></a>                        <a href="Javascript:void(0)"><img src="img/[3].gif" onclick="insertsmilie('[3]')" border="0"></a>


    </div>
    <div>这是jsp页面的相关代码 上面有js的代码  如果能给出源代码 我再加分  我的邮箱是[email protected]