页面获取下拉选项

页面获取下拉选项:
1.
<head>
    <title>运维平台</title>
    <link rel="stylesheet" type="text/css" href="/static/Css/Deploy/deploy.css">
    <link rel="stylesheet" type="text/css" href="/static/Css/Public/header.css">
    <link rel="stylesheet" type="text/css" href="/static/Css/Public/menu.css">
</head>
<body>
    <include file="Public:header"/>
    <div class="content">
        <include file="Public:menu"/>
        <div class="con fl">
        <label class="condition">应用系统</label>
        <select name="application" class="monitor">
            </select>
            
            <label class="condition">全局流水号</label><input type="text" name="esbserviceflowno" class="monitor01">
            
            <label class="condition">ESB内部流水号</label>
            <select name="deployip" class="monitor">
            </select>
           
    
    <input type="submit" value="生成ESB日志" class="publish">
    <input type="submit" value="查看对应日志" class="check">
        </div>
                    <table class="gridtable fr">
            <tr><th>消息</th></tr>
        </table>
    </div>
</body>
<script type="text/javascript" src="/static/Js/jquery-2.2.2.min.js"></script>
<script type="text/javascript" src="/static/Js/Deploy/deploy.js"></script>
<!script type="text/javascript" src="/static/Js/Public/menu.js"><!/script>
<script type="text/javascript" src="/static/Js/Public/ajax.js"></script>
</html>

2.
cat viewesb.js 
$(function(){
          var _env_select = $("select[name='application']");
        var _esbserviceflowno_select= $("input[name='esbserviceflowno']");
        console.log('aaaaaaaaaaaaaa');
        console.log(_env_select);
        console.log('aaaaaaaaaaaaaa');
        console.log('bbbbbbbbbbbbbb');
        console.log(_esbserviceflowno_select);
        console.log('bbbbbbbbbbbbbb');
                getTemp("abc");    
        function getTemp(env){
        var data = {};
        var successfn = function(jdata){
            var _HTML = "";
            _env_select.html("");
            $.each(jdata,function(i,val){
                _HTML = _HTML + "<option value="+jdata[i][0]+">"+jdata[i][0]+"</option>";
            });
            _env_select.html(_HTML);
        };
        var errorfn = function(jdata){
            alert("数据返回出错");
        };
        
        $.ajax({
            type: "get",
            data: data,
            url: "/api/getdeployapp",
            dataType: "json",
            success: function(d){
                successfn(d);
            },
            error: function(e){
                errorfn(e);
            };
        });
    };
});

3.
20.5.101.31_/root>vim /django/mysite/news/views.py
20.5.101.31_/root>mysql -uroot -p1234567 --socket=/data01/mysql/mysql.sock
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 378244
Server version: 5.6.22-log Source distribution

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

mysql> use DEVOPS;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select distinct appname from  publish;
+-----------+
| appname   |
+-----------+
| TEST      |
| ESB系统   |
+-----------+
2 rows in set (0.00 sec)
原文地址:https://www.cnblogs.com/hzcya1995/p/13349057.html