a标签POST请求
参考Send post request on click of href in JSP
<form name="submitForm" method="POST" action="/servlet/ServletName">
<input type="hidden" name="param1" value="param1Value">
<A HREF="javascript:document.submitForm.submit()">Click Me</A>
</form>
参考Making href (anchor tag) request POST instead of GET?
$(function() {
$("#employeeLink").on("click",function(e) {
e.preventDefault(); // cancel the link itself
$.post(this.href,function(data) {
$("#someContainer").html(data);
});
});
});
参考Make a link use POST instead of GET
<form name="myform" action="handle-data.php" method="post">
<label for="query">Search:</label>
<input type="text" name="query" id="query"/>
<button>Search</button>
</form>
<script>
var button = document.querySelector('form[name="myform"] > button');
button.addEventListener(function() {
document.querySelector("form[name="myform"]").submit();
});
</script>
参考How can I submit a POST form using the <a href=“…”> tag?
<form action="your_url" method="post">
<button type="submit" name="your_name" value="your_value" class="btn-link">Go</button>
</form>
1790

被折叠的 条评论
为什么被折叠?



