Red de conocimiento informático - Material del sitio web - ¿Cómo implementar directamente un enlace de tres niveles en jsp, simplemente escríbalo directamente en jsp sin extraer datos de la base de datos? ¡Gracias!

¿Cómo implementar directamente un enlace de tres niveles en jsp, simplemente escríbalo directamente en jsp sin extraer datos de la base de datos? ¡Gracias!

1: archivo JS:

Copiar código

función Dsy(){

this.Items = {}

}

Dsy.prototype.add = function(id,iArray)

{

this.Items[id] = iArray

}

Dsy.prototype.Exists = function(id)

{

if(typeof(this.Items[id]) == "indefinido") devuelve falso ;

devolver verdadero

}

cambio de función(v){

var str="0";

for(i=0;i

var ss=document.getElementById(s[v]);

con(ss){

longitud = 0;

opciones [0]=nueva opción( opt0[v],opt0[v]);

if(v && document.getElementById(s[v-1]).selectedIndex>0 || !v)

{

if(dsy.Exists(str)){

ar = dsy.Items[str];

for(i=0;i

if(v)opciones [1].selected = true; }

}

if(++v

}

}añadir ("0_0_1",["Matemáticas","Chino"]);

dsy.add("0_1",["Clase 1","Clase 2","Clase 3"]); /p>

dsy.add("0_1_0",["Matemáticas","Chino","Inglés","Arte"]);

dsy.add("0_1_1",[" Matemáticas", "Chino", "Inglés", "Arte"]]);

dsy.add("0_1_2",["matemáticas", "idioma", "inglés", "arte"]

var s=["provincia", "ciudad", "condado"]

var opt0 = ["grado", "clase", "materia"];

configuración de función(){

for(i=0;i

document.getElementById(s[i] ).onchange=new Function("cambiar("+(i+1)+")");

cambiar(0); 2: formulario de enlace, archivo html

<

p>Copiar código

<./Select>

< Seleccione id="county" runat="server" NAME="city">