Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- type: "POST",
- url: "mail.php",
- data: dataString,
- success: function(data) {
- $(".contact-form").hide();
- $(".alt-contact").hide();
- // Depending on what the PHP script returned, display a message of success or error
- if (data == 1) {
- $(".contact-form").html("<div class='success-message'><div class='success-image'></div><div class='success-title'>Success! The message has been sent!</div><div class='success-body'>I'll get back to you right away.</div></div>");
- }
- else {
- $(".contact-form").html("<div class='error-message'><div class='error-image'></div><div class='error-title'>Whoops! An error occurred.</div><div class='error-body'>I'll get back to you ASAP.</div></div>");
- }
- $(".contact-form").fadeIn(500);
- }
- error: function(jqXHR, textStatus, errorThrown) {
- $(".contact-form").hide();
- $(".alt-contact").hide();
- // Inserts divs making up the success message for the form submission
- $(".contact-form").html("<div class='error-message'><div class='error-image'></div><div class='error-title'>Success! The message has been sent!</div><div class='error-body'>I'll get back to you right away.</div></div>");
- $(".contact-form").fadeIn(500);
- }
- });
- $.ajax({
- type: "POST",
- url: "mail.php",
- data: dataString,
- success: function(data) {
- // code
- }, <----- Right there!
- error: function(jqXHR, textStatus, errorThrown) {
- // code
- }
- });
- $(".contact-form").fadeIn(500);
- } , <-------- Missing a comma here
- error: function(jqXHR, textStatus, errorThrown) {
Add Comment
Please, Sign In to add comment