<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>test</title>
<script src="js/jquery.min.js"></script>
</head>
<body>
<div class="xtsz">
<div class="xtsz-con">
<form action="" method="post" onsubmit="return user()">
<input type="text">
<button type="submit">提交</button>
</form>
</div>
</div>
<script type="text/javascript">
$(function(){
function user() {
}
})
</script>
</body>
</html>
这样的编写方式为什么报user函数未定义?
user定义在函数的内部,属于局部变量,外部不能调用