Writing Byshawl. qiu _ basic knowledge about several similar features of server VBScript and JScript
Source: Internet
Author: User
Byshawl. qiu Abstract:
This article demonstrates several important applications of ASP server scripts.
Directory:
1. Traverse collection/Object
1.1 VBScript traversal form set
1.2 JScript traversal form set
2. Convert the value to a variable and assign a value to it.
2.1 VBScript convert a value to a variable and assign a value
2.2 JScript convert a value to a variable and assign a value
1. Traverse collection/Object
1.1 VBScript traversal form set
Linenum
<%
For each temp in request. Form
Response. write temp & ":" & request. form (temp)
Next
%>
1.2 JScript traversal form set
Linenum
<%
For (var $ e = new Enumerator (Request. Form );! $ E. atEnd (); $ e. moveNext ()){
Response. Write ($ e. item () + ':
'+ Request. Form ($ e. item ()));
}
%>
2. Convert the value to a variable and assign a value to it.
2.1 VBScript convert a value to a variable and assign a value
Linenum
<%
For each temp in request. Form
Execute temp & "= request. form (temp )"
Next
%>
2.2 JScript convert a value to a variable and assign a value
Linenum
<%
Var $ xml = new ActiveXObject ("microsoft. xmldom ");
$ Xml. load (Server. MapPath ('config. xml '));
Var using childnodesusing using xml.doc umentElement. selectSingleNode ('// siteconfig'). childNodes
For ($ e = new Enumerator ($ childNodes );! $ E. atEnd (); $ e. moveNext ()){
Eval ($ e. item (). nodeName + "= $ e. item (). text ");
}
$ Xml = null;
Response. Write (sitekeywords );
%>
3. dynamically include files
3.1 VBScript dynamic File Inclusion
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.