前端Button点击无反应--记一次Debug经历

最近在学习秒杀系统,前端有个秒杀按钮,显示什么都正常,就是点击无反应,复制人家提供的源代码发现是表单的单词拼错了,form拼成了from,小细节。

<!--错误代码-->
<from id="secKillForm" method="post" action="/secKill/doSeckill">
                    <input type="hidden" name="goodsId" th:value="${goods.id}">
                    <button class="btn btn-primary btn-block" type="submit" id="buyButton">立即秒杀</button>
</from>


<!--正确代码-->
<form id="secKillForm" method="post" action="/secKill/doSeckill">
                    <input type="hidden" name="goodsId" th:value="${goods.id}">
                    <button class="btn btn-primary btn-block" type="submit" id="buyButton">立即秒杀</button>
</form>
posted @ 2021-10-17 20:43  jb-simple  阅读(511)  评论(0编辑  收藏  举报