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'));
        }
  • 相关阅读:
    用nginx解决前端跨域问题
    vue中router-link的详细用法
    leetcode 148 排序链表
    leetcode 146 LRU缓存机制
    leetcode 101 对称二叉树
    leetcode 84 柱状图中最大的矩形
    leetcode76 最小覆盖子串
    C++ map, unordered_map
    python随机函数
    丑数
  • 原文地址:https://www.cnblogs.com/soonfly/p/1646619.html
Copyright © 2011-2022 走看看