onShowNameTipsMouseenter: function(e) { var target = e.target; var containerLength = $(target).width(); var textLength = target.scrollWidth; var text = $(target).html(); //console.log("contentLength:" + containerLength); //console.log("text
<script type="text/javascript"> function checkRoleName(){ var userName=document.getElementById("roleName").value; if(userName.replace(/\s/g,'')==''){ alert("请输入角色名称"); document.getElementById("roleName").focus
一.js判断文本中是否有表情符号表情 isEmojiCharacter(substring){ for ( var i = 0; i <substring.length; i ++){ var hs = substring.charCodeAt(i); if (0xd800 <= hs && hs <= 0xdbff){ if (substring.length> 1){ var ls = substring.charCodeAt(i + 1); var uc =(
js如何判断小数点后有几位 <script> var n=3.143423423;alert(n.toString().split(".")[1].length); </script> js javascrip 截取小数点后几位 第一种,利用math.round var original=28.4531) //round "original" to two decimalsvar result=Math.round(original*100)