我有以下 ajax 代码...似乎无法正常工作...
$('form').submit(function () {
var email = $('#useremail').val();
var name = $('#username').val();
$.ajax({
url: '/Landing2/mail.php',
type: 'POST',
data: {
email: email,
name: name
},
success: function (data) {
alert(data);
},
});
});
我的目录结构是
htdocs
Landing2
index.php (From where i am making request")
mail.php
这有什么问题吗?