JScript client self-write Request object

xiaoxiao2021-03-06  41

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") {returnid.item [strkey];} else {return ";}} thunderbirdRequestonit (/ ([^? & ] [AZ / D] *) = ([^ # &] *) / GIM, this.current, this.count, this.curs);} Function ThunderbirdRequestCookies () {this.curs = 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 "";}} ThunderbirdRequestonit (/ (^? &] [AZ / D] *) = ([^ # &;] *) / GIM, this.current, this.count, this.item);} function [. RegExp $ 1]. ThunderBirdRequestOnInit (RegExpRule, Current, count, Item) {if (! Current = "") {while (! RegExpRule.exec (Current) = null) {Item = RegExp $ 2; Item [count] = RegExp $ 2; coun T = 1;}}}

Several modifications came out this

I used scripting.dictionary to use the type attribute final or used back to array

Instructions

Document.write (Request.QueryString.Item ("Test"));

转载请注明原文地址:https://www.9cbs.com/read-78804.html

New Post(0)