private.js
资源名称:1.rar [点击查看]
上传用户:yrf020
上传日期:2007-07-24
资源大小:1287k
文件大小:1k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
HTML/CSS
- // 去空格,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;
- }
English
