There is an Enumerator object under JScript that can traverse the collection. According to its documentation, I wrote the following program, which can traverse the entire Request.QueryString collection. Copy the code. The code is as follows:
var params = new Enumerator(Request.QueryString);
while (!params.atEnd()) {
Response.Write(params.item() + : + Request.QueryString(params.item()) + <br />);
params.moveNext();
}
The fly in the ointment is that the Request object itself is not a collection, so the Request object cannot be traversed. The following line of code will report an error:
Copy the code code as follows:
var params = new Enumerator(Request);