<nav>
<ul class="nav nav-pills pull-right">
<li role="presentation">
<form action="/logout" method="POST" id="logout-form">
<a href="#" onClick="document.getElementById('logout-form').submit()">Logout</a>
</form>
</li>
<li role="presentation"><a href="/login">Login</a></li>
<li role="presentation"><a href="/register">Register</a></li>
</ul>
</nav>
表单链接的设计不正确。有人知道我能尝试什么吗?
答案 0 :(得分:0)
实际上答案非常明显......
<form action="/logout" method="POST" id="logout-form"></form>
<li role="presentation">
<a href="#" onClick="document.getElementById('logout-form').submit()">Logout</a>
</li>
<li role="presentation"><a href="/login">Login</a></li>
<li role="presentation"><a href="/register">Register</a></li>