| JScript 客户端 Request 对象 |
|
|
作者:佚名 文章来源:网贝整理 点击数:
更新时间:2005-4-14  |
|
| |
|
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") );
|
| 文章录入:admin 责任编辑:admin
|
|
上一篇文章: 只能限制输入中文的方法 js方法function isCharsInBag (s, bag)
下一篇文章: 用js绘图 |
| 【字体:小
大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】
|