(推荐一个超好的JS函数库)S.Sams Lifexperience ScriptClassLib

2019-06-02 21:22:29于丽

 38                this.ns4=(document.layers && !this.dom)?1:0; 
 39                this.mac=(this.ver.indexOf('Mac') > -1) ?1:0; 
 40                this.ope=(navigator.userAgent.indexOf('Opera')>-1); 
 41                this.ie=(this.ie6 || this.ie5 || this.ie4) 
 42                this.ns=(this.ns4 || this.ns5) 
 43                this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns5 || this.ns4 || this.mac || this.ope) 
 44                this.nbw=(!this.bw) 
 45                return this;
 46    },
 47
 48    /**//*    设为首页
 49        @url        要设为首页的地址
 50    */
 51    SetDefault : function ()
 52    {
 53        this.style.behavior='url(#default#homepage)';
 54        this.setHomePage(this.GetUrl());
 55        return false;
 56    },
 57
 58    /**//*    复制指定URL地址
 59        @Msg        要写入剪贴板的字符集
 60    */
 61    SetCopy    : function (Msg){
 62        if(navigator.userAgent.toLowerCase().indexOf('ie') > -1) {
 63            clipboardData.setData('Text',Msg);
 64            alert ("网址“"+Msg+"”n已经复制到您的剪贴板中n您可以使用Ctrl+V快捷键粘贴到需要的地方");
 65        }
 66        else