<script type="text/javascript">
function post(data, f) {
$.post("InputGoodType.aspx", data, f);
}
function ld(obj) {
var id = obj.getElementsByTagName("select")[0].value;
post("type=drop2&id=" + id, function (r) {
obj.getElementsByTagName("span")[1].innerHTML = CreateSelect(eval(r));
})
}
function s() {
var div1 = document.getElementById("Attribute");
div = document.createElement("div");
div1.appendChild(div);
post("type=drop", function (r) {
var span = document.createElement("span");
var span1 = document.createElement("span");
span.innerHTML = CreateSelect(eval(r), 1);
div.innerHTML = "<a href=\"javascript:void(0);\" οnclick=\"remove(this)\">[-]</a>";
div.appendChild(span);
div.appendChild(span1);
ld(div);
})
}
function CreateSelect(arr, number) {
var str = "<select style=\"width:200px;\" name=\"att\">";
if (number != undefined) {
str = "<select οnchange=\"ld(this.parentNode.parentNode)\" style=\"width:200px;\">";
}
for (var i = 0; i < arr.length; i++) {
str += "<option value="+arr[i][0]+">"+arr[i][1]+"</option>"
}
str += "</select>";
return str;
}
function remove(obj) {
obj.parentNode.parentNode.removeChild(obj.parentNode);
}
</script>
js
最新推荐文章于 2024-06-09 19:30:00 发布