zoukankan      html  css  js  c++  java
  • option生成

     function loadclass()
        {
            jQuery.ajax({
                url: "/Assets/GetDistinctClassNameByType",
                data: { typeid: $("#DDLTypeID").val() },
                type: "post",
                cache: false,
                dataType: "json",
                success: function(msg) {
                var select_root = document.getElementById('DDLAssetsName');
                select_root.options.length = 0;
                select_root.add(new Option("请选择", '-1'));
                    var data = msg.options;
                    $.each(data, function(i, n) {
                        if(n.text&&n.value)
                        {
                        var option = new Option(n.text, n.value);
                        select_root.add(option);
                        }
                    });
                }
            });
            var select_root = document.getElementById('DDLAssetsModel');
                select_root.options.length = 0;
                select_root.add(new Option("请选择", '-1'));
        }
  • 相关阅读:
    上传图片并压缩
    一张图教会你es6
    字符串生成二维码
    city-picker城市选择,三级联动
    jquery本地文件
    前端颜色选择器
    某音乐api
    js正则那些事
    Android判断网络是否打开,并打开设置网络界面
    execute、executeQuery和executeUpdate之间的区别 转
  • 原文地址:https://www.cnblogs.com/soonfly/p/1646619.html
Copyright © 2011-2022 走看看