出于某种原因,我不知道为什么我的表单没有使用$( "#target" ).submit();提交。
<html>
<head>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/2.2.3/jquery.min.js'></script>
<script>
function saveItem()
{
console.log($("#frm"));
$("#frm").submit();
}
</script>
</head>
<body>
<form id="frm" action="form.php" method="post">
<a href="javascript:;" title="Save" onclick="saveItem()">save</a>
<button type="submit" id="submit">Save</button>
</form>
</body>
</html>