每次向服务器发送 ajax 请求时,我都会在表单上收到此错误
Uncaught TypeError: Cannot call method 'split' of undefined
我正在使用 Struts-Jquery 插件。
这是我的表格
<!DOCTYPE HTML>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<html>
<head>
<script
language="JavaScript"
src="utils.js"
type="text/javascript">
</script>
<script
language="JavaScript"
src="validation.js"
type="text/javascript">
</script>
<sj:head />
</head>
<body>
<h3>Register for a prize by completing this form.</h3>
<div id="divErrors"></div>
<s:form action="register" id="form">
<label>UserName</label>
<s:textfield name="userBean.username" />
<s:fielderror />
<sj:submit targets = "form" value="AJAX Submit" />
</s:form>
<audio src="x.mp3" controls>Your browser
does not support the audio element.
</audio>
</body>
</html>