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

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

108    /**//*    获取页面来源 */
109    GetFrom : function(){
110        return document.referrer;
111    },
112
113    /**//*    获取指定的URL参数值
114        @name        参数名
115    */
116    Request : function(name){
117        var GetUrl = this.GetUrl();
118        var Plist = new Array();
119        if(GetUrl.indexOf('?') > 0)
120        {
121            Plist = GetUrl.split('?')[1].split('&');
122        }
123        else if(GetUrl.indexOf('#') > 0)
124        {
125            Plist = GetUrl.split('#')[1].split('&');
126        }
127        if (GetUrl.length > 0)
128        {
129            for(var i=0; i<Plist.length; i++)
130            {
131                var GetValue = Plist[i].split('=');
132                if (GetValue[0].toUpperCase() == name.toUpperCase())
133                {
134                    return GetValue[1];
135                    break;
136                }
137            }
138            return;
139        }
140    },
141
142    /**//*    直接将HTML写到新窗口
143        @title        标题