www.gusucode.com > 枫的记忆个人主页程序源码程序 > downcode.com\fengdejiyizh\admin\eWebEditor\Admin\private.js
// 去空格,left,right,all可选 function BaseTrim(str){ lIdx=0;rIdx=str.length; if (BaseTrim.arguments.length==2) act=BaseTrim.arguments[1].toLowerCase() else act="all" for(var i=0;i<str.length;i++){ thelStr=str.substring(lIdx,lIdx+1) therStr=str.substring(rIdx,rIdx-1) if ((act=="all" || act=="left") && thelStr==" "){ lIdx++ } if ((act=="all" || act=="right") && therStr==" "){ rIdx-- } } str=str.slice(lIdx,rIdx) return str } // 基本信息提示,得到焦点并选定 function BaseAlert(theText,notice){ alert(notice); theText.focus(); theText.select(); return false; }