请求地址:http://你的域名/feedback.html
字段说明
[post_code] => 验证码
[title] => 留言主题
[message] => 留言内容
[name] => 联系人称呼
[phone] => 联系人电话
<link rel="stylesheet" href="/static/eten/tn-code/style.css">
<script type="text/javascript" src="/static/common/feedback/tn-code/tn_code.js?v=2020"></script>
<script type="text/javascript">
var $TN = tncode;
$TN.init();
$TN.onsuccess(function(){
var page_loading = layer.load(1, {shade: [0.1,"#fff"]});
//提交
$.ajax({
//请求方式
type : "POST",
//请求地址
url : "/feedback.html",
//数据,json字符串
data : $('.contact-form').serialize(),
//请求成功
success : function(result) {
if(result.status==1){
layer.msg(result.msg,{icon:1,time:3000});
}else{
layer.msg(result.msg,{icon:2,time:3000});
}
setTimeout(function(){location.reload();}, 3000);
},
//请求失败,包含具体的错误信息
error : function(e){
layer.msg("请求失败",{icon:2,time:3000});
}
});
});
</script>