我有 3 个输入需要检查是否为空,然后运行 ajax 调用。
有人可以协助编写 IF 语句
$('input[name=newsave]').click(function(){
var neworgy = $('input[name=neworg]').val();
var newurly = $('input[name=newurl]').val();
var newtrackingy = $('input[name=newtracking]').val();
var dataString = 'email=<?php echo $userid;?>&neworg='+ neworgy +'&newurl='+ newurly +'&newtracking='+ newtrackingy;
$.ajax({
type: "POST",
url: "new-token.php",
data: dataString,
success: function() {
location.reload();
}
});
});