<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<s:head theme="ajax"/>
<script>
function submitFormValue(){
dojo.io.bind(
{
url: "JsonReceid.do",
mimetype: "text/html",
// method:"POST", //如果去掉此行注解就不会有问题
sync: true,
useCache: false,
preventCache: false,
timeoutSeconds: 3000,
formNode: document.getElementById("sendData"),
load: function(type, data, evt) { alert(data); },
error: function(type, error) { alert(error.message); }, //error is dojo.io.Error
timeout: function(type) { alert("请求超时!"); }
}
);
}
</script>
</head>
<body>
<form name="sendData">
名字<input name="chineseName"/>
<input type="button" value="提交" οnclick="submitFormValue();"/>
</form>
</body>
</html>
ajax 提交数据产生乱码的原因
最新推荐文章于 2019-03-08 15:32:04 发布