var Request =
{
QueryString: new ThunderBirdRequestQueryString(),
Cookies: new ThunderBirdRequestCookies()
}
function ThunderBirdRequestQueryString()
{
this.Current = document.location.search;
this.count = 0;
this.Item = new Array();
this.item = function (strKey)
{
if ( typeof(this.Item[strKey]) != "undefined" )
{
return this.Item[strKey];
}
else
{
return "";
}
}
ThunderBirdRequestOnInit(/([^?&][a-z/d]*)=([^#&]*)/gim, this.Current, this.count, this.Item);
}
function ThunderBirdRequestCookies()
{
this.Current = document.cookie;
this.count = 0;
this.Item = new Array();
this.item = function (strKey)
{
if ( typeof(this.Item[strKey]) != "undefined" )
{
return this.Item[strKey];
}
else
{
return "";
}
}
ThunderBirdRequestOnInit(/([^?&][a-z/d]*)=([^#&;]*)/gim, this.Current, this.count, this.Item);
}
function ThunderBirdRequestOnInit(RegExpRule, Current, count, Item)
{
if ( Current != "" )
{
while ( RegExpRule.exec(Current) != null )
{
Item[RegExp.$1] = RegExp.$2;
Item[count] = RegExp.$2;
count += 1;
}
}
}
几经修改 才出来这个
用过 Scripting.Dictionary 也用过 类型属性 最后还是用回 数组
使用方法
document.write( Request.QueryString.item("test") );