if(subject=="") { alert('留言主题不能为空'); return false; } if(linkman=="") { alert('联系人不能为空'); return false; } if(mobile=="") { alert('联系方式不能为空'); return false; } if(email=="") { alert('邮箱不能为空'); return false; } if(content=="") { alert('{lang_conentmsg}'); return false; } $.ajax({ url: '//www.dq800.com/message/add.aspx', data: { 'mid': 11728, 'subject': subject, 'linkman': linkman, 'email': email, 'mobile': mobile, 'content': content, 'code': $('#code').val()}, dataType: "jsonp", jsonp: "callback", jsonpCallback: "success_jsonp", timeout: 5000, dataFilter: function (json) { console.log("jsonp.filter:" + json); return json; }, success: function (json, textStatus) { console.log(json) console.log(textStatus) if (json.status == 1) { layer.confirm('提交成功', { btn: ['继续留言', '返回'] //按钮 }, function () { window.location.reload(); }, function () { window.location.href = "/"; }); } else { alert(json.msg); } console.log("jsonp.success:" + json.msg); }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log("jsonp.error:" + textStatus); } }); }