1.判断是否有汉字
    var msg=/[^/x00-/xff]/g.test(str)?"有汉字":"无汉字"

2.screen对象的属性解释
    screen.availHeight(availWidth )  获取系统屏幕的工作区域高度(宽度),排除 Microsoft; Windows 任务栏。 
    screen.height(width) 获取屏幕的垂直(水平)分辨率
    screen.updateInterval 获取屏幕的更新时间

3.关于尺寸
    document.body.clientWidth(clientHeight ) 网页可见区域宽(高)
    document.body.offsetWeight(offsetHeight )网页带边线的可见区域宽(高) 
    document.body.scrollWidth(scrollHeight)网页正文全文宽(高)
    document.body.scrollTop (scrollLeft )网页滚动条的高(宽)
    window.screenTop(screenLeft)网页正文部分上(左)
    
4.特殊用途
     <input type=button value=导入收藏夹       οnclick="window.external.ImportExportFavorites(true,'http://localhost');">
     <input type=button value=导出收藏夹 οnclick="window.external.ImportExportFavorites(false,'http://localhost');"> 
     <input type=button value=整理收藏夹 οnclick="window.external.ShowBrowserUI('OrganizeFavorites', null)"> 
     <input type=button value=语言设置 οnclick="window.external.ShowBrowserUI('LanguageDialog', null)"> 
     <input type=button value=加入收藏夹 οnclick="window.external.AddFavorite('http://www.google.com/', 'google')"> 
     <input type=button value=加入到频道 οnclick="window.external.addChannel('http://www.google.com/')"> 
     <input type=button value=PrivacySettings οnclick="window.external.showBrowserUI('PrivacySettings',null)"> 
    
    
5.验证浏览器
    
     function checkBrowser() 
     { 
     this.ver=navigator.appVersion 
     this.dom=document.getElementById?1:0 
     this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0; 
     this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
     this.ie4=(document.all && !this.dom)?1:0; 
     this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
     this.ns4=(document.layers && !this.dom)?1:0; 
     this.mac=(this.ver.indexOf('Mac') > -1) ?1:0; 
     this.ope=(navigator.userAgent.indexOf('Opera')>-1); 
     this.ie=(this.ie6 || this.ie5 || this.ie4) 
     this.ns=(this.ns4 || this.ns5) 
     this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns5 || this.ns4 || this.mac || this.ope) 
     this.nbw=(!this.bw) 
     return this; 
     } 
    
6.操作cookie
    
    function setcookie(key,value){
        document.cookie=key+"="+escape(value)+"; ";
    }
    function getcookie(key){
        var cookie=document.cookie.split("; ");
        for(var i=0;i<cookie.length;i++){
            return cookie.split("=")[0]==key?unescape(cookie.split("=")[1]);
        }
    }
    function delcookie(key){
        document.cookie =key+ "=aa"; expires=Fri, 31 Dec 1999 23:59:59 GMT;"; 
    }
    
7.js 下载文件

 function DownURL(strRemoteURL,strLocalURL) 
 { 
     try { 
         var xmlHTTP=new ActiveXObject("Microsoft.XMLHTTP"); 
         xmlHTTP.open("Get",strRemoteURL,false); 
         xmlHTTP.send(); 
         var adodbStream=new ActiveXObject("ADODB.Stream"); 
         adodbStream.Type=1;//1=adTypeBinary  
         adodbStream.Open(); 
         adodbStream.write(xmlHTTP.responseBody); 
         adodbStream.SaveToFile(strLocalURL,2); 
         adodbStream.Close(); 
         adodbStream=null; 
         xmlHTTP=null; 
     } 
     catch(e){ 
         window.confirm("下载URL出错!"+e); 
     } 
     window.confirm("下载完成.");  
 }
   
8.验证链接是否有效
    
    function checkUrl(url){
        var xmlhttp=new ActiveObject("microsoft.xmlhttp");
        xmlhttp.open("GET",url,false);
        try{
            xmlhttp.send();
        }catch(e){
            return false; 
        }
        return xmlhttp.Status==200?true:false; 
    }
    
9.链接数据库
    
    function connectionDB(dataSource,DBName,UId,UPwd){
        var connStr="Provider=SQLOLEDB.1;Data Source="+dataSource+";Initial Catalog="+DBName+";User ID="+UId+";Password="+UPwd;
        var conn=new ActiveXObject("ADODB.Connection");
        conn.open(connStr);
        var rs=new ActiveXObject("ADODB.Recorddest");
        var sql="select * name tbName"; //数据库表名为 tbName 有字段 (id,name)
        re.open(sql,conn);//打开链接
        var json='{"tbName":[';
        while(!rs.EOF){ //开始读取
            json+='{"id":"'+rs("id")+'"'+',"name":"'+rs("name")+'"},';
            rs.moveNext;
        }
        json=json.RTrim(',')+"]}";
        rs.close();//读取关闭
        rs=null;
        conn.close();//链接关闭
        conn=null;
    }
    
10 Math 对象
    
    LN10 (10的自然对数)
    PI
    SQR1_2 (1/2的平方根)
    
    abs(x) x的绝对值
    acos(x) x的 arc cosine 值
    asin(x) x的 arc sin值
    atan(x) x的 arc tangent值
    ceil(x) 大于等于x的最小整数
    exp(x)  e的x次方值
    floor(x) 小于等于x的最大整数
    log(x) x的对数值
    max(x,y) x,y 中的最大值
    min(x,y) x,y中最小值
    round(x) 舍入到最近整数(四舍五入)
    sin(x) x的 sin值
    cos(x)  x的 consine值
    sqrt(x) x的平方根
    tan(x) x的tangent值