make ajax post request, sending in form data

master
Matt Huntington 9 years ago
parent da2e3eb5ee
commit 3eb85178bf

@ -14,7 +14,7 @@
<div class="content"> <div class="content">
<h1>Emissary Talent</h1> <h1>Emissary Talent</h1>
<p class="major">A full service agency for representing the finest talent across the US.</p> <p class="major">A full service agency for representing the finest talent across the US.</p>
<ul id="email" class="actions vertical"> <ul class="actions vertical">
<li><a href="#contact" class="button big wide smooth-scroll-middle">Contact Us!</a></li> <li><a href="#contact" class="button big wide smooth-scroll-middle">Contact Us!</a></li>
</ul> </ul>
</div> </div>
@ -105,7 +105,13 @@
$('form').submit((event)=>{ $('form').submit((event)=>{
event.preventDefault(); event.preventDefault();
$.ajax({ $.ajax({
url:'/mail.php' url:'/mail.php',
method:POST,
data: {
name: $('#name').val(),
email: $('#email').val(),
message: $('#message').val(),
}
}).then((data)=>{ }).then((data)=>{
console.log(data); console.log(data);
}); });

Loading…
Cancel
Save