Newer
Older
NotifyInfo / notifyServer / src / main / resources / templates / index.html
<!DOCTYPE html >
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>发射器</title>
    <style>
        body{ text-align:center;
            margin: 0 auto;
        padding: 20px;}
        .space {
            margin-top: 20px;
            margin-bottom: 20px;
        }
        .tips {
            color:red;
            text-align: center;
        }
    </style>
    <link rel="stylesheet" href="css/buttons.css">
    <script src="js/jquery-2.1.4.js"></script>
</head>
<body>

<div>
    <a href="#" onclick="update(1)" class="button button-inverse button-circle button-jumbo">右1</a>
    <a href="#" onclick="update(2)" class="button button-primary button-circle button-jumbo">右2</a>
    <a href="#" onclick="update(3)" class="button button-action button-circle button-jumbo">右3</a>
    <a href="#" onclick="update(4)" class="button button-highlight button-circle button-jumbo">右4</a>
    <a href="#" onclick="update(5)" class="button button-caution button-circle button-jumbo">右5</a>
    <a href="#" onclick="update(6)" class="button button-royal button-circle button-jumbo">右6</a>
    <a href="#" onclick="update(7)" class="button button-primary button-circle button-jumbo">右7</a>
</div>
<div class="space">
    <a href="#" onclick="update(8)" class="button button-highlight button-circle button-jumbo">中8</a>
</div>
<div>
    <a href="#" onclick="update(11)" class="button button-inverse button-circle button-jumbo">左1</a>
    <a href="#" onclick="update(12)" class="button button-primary button-circle button-jumbo">左2</a>
    <a href="#" onclick="update(13)" class="button button-action button-circle button-jumbo">左3</a>
    <a href="#" onclick="update(14)" class="button button-highlight button-circle button-jumbo">左4</a>
    <a href="#" onclick="update(15)" class="button button-caution button-circle button-jumbo">左5</a>
    <a href="#" onclick="update(16)" class="button button-royal button-circle button-jumbo">左6</a>
    <a href="#" onclick="update(17)" class="button button-primary button-circle button-jumbo">左7</a>
</div>

<div><span class="tips" id="result"></span> </div>

<script>

    function update(id) {

        $.ajax({
            url: "/notify?id="+id,
            type: "GET",
            async: true,
            success: function (res) {
                console.log(res);
                $("#result").text(res);
            }
        });
    };
</script>

</body>
</html>