今天写了一个ajax post application的请求函数如下
function telnetTest(obj, url, x1, x2) {
console.log(url);
console.log(x1);
console.log(x2);
layer.confirm('Confirm to telnet?', {btn: ['Yes', 'Canal'], title: "Tips"}, function (index) {
$.ajax({
type: 'POST',
url: url,
data: {
'x1':x1,
'x2':x2
},
contentType: 'application/json',
dataType: 'json',
success: function (data) {
if (data.resultCode == "200") {
layer.msg(data.resultMsg, {icon: 3, time: 3000});
}
else {
layer.msg(data.resultMsg, {icon: 4, time: 4000});
}
},
error: function (data)