解决方案 »

  1.   


    <script>
        var groups = document.isc.example.options.length;
        var group = new Array(groups);
        for (i = 0; i < groups; i++)
            group[i] = new Array()
        group[0][0] = new Option("所在市");
        group[1][0] = new Option("请选择河南省所在市", "");
        group[1][1] = new Option("郑州", "11");
        group[1][2] = new Option("新乡", "12");
        group[1][3] = new Option("开封", "13");
        group[2][0] = new Option("请选择山东所在市", " ");
        group[2][1] = new Option("青岛", "21");
        group[2][2] = new Option("济南", "22");
        var temp = document.isc.stage2
        function redirect(x) {
            for (m = temp.options.length - 1; m > 0; m--)
                temp.options[m] = null;
            for (i = 0; i < group[x].length; i++) {
                temp.options[i] = new Option(group[x][i].text, group[x][i].value);
            }
            temp.options[0].selected = true;
            redirect1(0);
        }
        var secondgroups = document.isc.stage2.options.length;//这里写错了!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        var secondgroup = new Array(groups);
        for (i = 0; i < groups; i++) {
            secondgroup[i] = new Array(group[i].length);
            for (j = 0; j < group[i].length; j++) {
                secondgroup[i][j] = new Array();
            }
        }
        secondgroup[0][0][0] = new Option("所在区", " ");
        secondgroup[1][0][0] = new Option("所在区", " ");
        secondgroup[1][1][0] = new Option("郑州", " ");
        secondgroup[1][1][1] = new Option("管城区", "111");
        secondgroup[1][1][2] = new Option("金水区", "112");
        secondgroup[1][1][3] = new Option("二七区", "113");
        secondgroup[1][2][0] = new Option("新乡", " ");
        secondgroup[1][2][1] = new Option("红旗区", "121");
        secondgroup[1][2][2] = new Option("牧野区", "122");
        secondgroup[1][2][3] = new Option("凤泉区", "123");
        secondgroup[1][3][0] = new Option("开封", " ");
        secondgroup[1][3][1] = new Option("龙亭区", "131");
        secondgroup[1][3][2] = new Option("鼓楼区", "132");
        secondgroup[2][0][0] = new Option("所在区", " ");
        secondgroup[2][1][0] = new Option("青岛", " ");
        secondgroup[2][1][1] = new Option("崂山区", "211");
        secondgroup[2][1][2] = new Option("四方区", "212");
        secondgroup[2][1][3] = new Option("城阳区", "213");
        secondgroup[2][2][0] = new Option("济南", " ");
        secondgroup[2][2][1] = new Option("天桥区", "221");
        secondgroup[2][2][2] = new Option("长清区", "222");
        var temp1 = document.isc.stage3;
        function redirect1(y) {
            for (m = temp1.options.length - 1; m > 0; m--)
                temp1.options[m] = null;
            for (i = 0; i < secondgroup[document.isc.example.options.selectedIndex][y].length; i++) {
                temp1.options[i] = new Option(secondgroup[document.isc.example.options.selectedIndex][y][i].text, secondgroup[document.isc.example.options.selectedIndex][y][i].value);
            }
            temp1.options[0].selected = true;
        }
        </script>
      

  2.   

    http://jsbin.com/zoqejisede/edit?html,output
      

  3.   

    <script luaguage="javascript" src="ssld.js">这种嵌入方式为什么不可以了,为什么你把javascript代码放在了后面啊?