ASP stores data using client arrays. I have seen many such applications. But this technology caught my attention when I recently studied several sets of traffic exchange alliance systems.
Next I will talk about how to use it. First I will give an example of simply applying JavaScript without integrating ASP.
1. jsCopyCodeThe Code is as follows: var A = new array ();
VaR temp = "<Table> ";
A [0] = new array (1, "A Hui Nan", "male ");
A [1] = new array (2, "White Rabbit", "female ");
A [2] = new array (3, "Xiaoqi", "female ");
For (VAR I = 0; I <A. length; I ++)
{
Temp = temp + "<tr>"
For (var j = 0; j <A [0]. length; j ++)
{
Temp = temp + "<TD>" + A [I] [J] + "</TD> ";
}
Temp = temp + "</tr>"
}
Temp = temp + "</table> ";
Document. Write (temp );
1.html copy Code the code is as follows:
store data in arrays
output result of 1.html:
1 ahui Nan male
2 white rabbit
3 Xiao Qi female
script language = "JavaScript" type = "text/JavaScript" src = "1.js">
replace it with
. save JS as 1. ASP and make the following changes: copy Code the code is as follows: var A = new array ();
var temp ="
{< br> temp = temp + " ";
}< br> temp = temp + ""
}< br> temp = temp + "
"; <% database connection code, open the connection for I = 1 to 3 If objrs. EOF then exit for %> A [<% = I %>] = new array (<% = objrs (0) %>, "<% = objrs (1) %>", "<% = objrs (2) %>") <% objrs. movenext next %> for (VAR I = 0; I <. length; I ++) {< br> temp = temp + "
" for (VAR J = 0; j
| " + A [I] [J] + " |
";
document. write (temp);
I didn't post the complete ASP code. I only wrote a little bit. Please add it by yourself.