for(var i =0; i
{
var str=data.charAt(i);
strchar =strchar+str;
//if(/[-A-Z|a-z|0-9]/g.test(str))
if(/[u00-uFF]/g.test(str))
{
charCount++;
}
else
{
charCount = charCount + 2;
}
if(len - charCount <1)
{
break;
}
}
return strchar;
}
function SetSignature(newSignature)
{
var signature = document.getElementById('signature');
signature.setAttribute('title', newSignature);
var str= new String(newSignature);
var strText;
var strLen = 34;
if(GetStrType(str)== 1)
{
strLen = 38;
}
var tmpLen = GetStrLength(str);
if(tmpLen > strLen)
{
var strtemp = GetStrData(str, strLen);
strText= strtemp+"...";
}
else
{
strText = newSignature;
}
signature.innerText = strText;
// signature.innerText = (newSignature.length > 20) ? newSignature.substr(0, 20) + "..." : newSignature;
}
阅读(1806) | 评论(0) | 转发(0) |