order-top:none}
    </style>
</head>

<body>
<div class="warp">
    <div id="msg"></div>
    <div>
        <input type="text" onkeypress="send(event,this)" placeholder="回车发送 /name 昵称 改名" />
    </div>
    <div class="infos">
        在线人数：
        <span id="online-nums"></span>
    </div>
</div>

<script>
    var ws = new WebSocket('ws://' + location.host + ':9510/chat');
    //添加状态判断，当为OPEN时，发送消息
    if (ws.readyState===1) {
        ws.send('test');
  