<script language="javascript"> 
function insertemot(emotCode) 

var txtarea = document.lw_form.usercontent; 
emotCode = emotCode; 
if (txtarea.createTextRange && txtarea.caretPos) 

var caretPos = txtarea.caretPos; 
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? emotCode + ' ' : emotCode; 
txtarea.focus(); 

else 

txtarea.value  += emotCode; 
txtarea.focus(); 

} ***************************************************************************** 
txtarea.createtextrange 啥意思? 
txtarea.carepos啥意思? 
var caretPos = txtarea.caretPos;这句为什么声明的变量名caretpos可以和txtarea.caretpos同名? 
caretpos.text什么意思? 
该句caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? emotCode + ' ' : emotCode中的 
caretPos.text.charAt是什么意思? caretPos.text.length - 1什么意思? 
caretPos.text.charAt(caretPos.text.length - 1)什么意思? 
== ' ' ? emotCode + ' ' : emotCode;啥意思? 后面的跟个:emotcode什么意思? 
txtarea.focus什么意思? 
txtarea.value +=emotcode什么意思?