Last active
August 29, 2015 13:57
-
-
Save guinslym/9457614 to your computer and use it in GitHub Desktop.
coffeescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready -> | |
$("#new_contact").on("ajax:success", (e, data, status, xhr) -> | |
$("#new_contact").append xhr.responseText | |
alert ":) I received it" | |
$(this.el).css("background-color", "#333") | |
$('.contact_form').css({'background-color':'#88ff88'}).animate({'background-color':'#114411'}, 1000) | |
).bind "ajax:error", (e, xhr, status, error) -> | |
$("#new_contact").append "<p>ERROR</p>" | |
alert "Something went wrong :( try again or contact me by email." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready -> | |
$("#new_contact").on("ajax:success", (e, data, status, xhr) -> | |
$("#new_contact").append xhr.responseText | |
alert ":) I received it" | |
$('.contact_form').css({'background-color':'#88ff88'}) | |
$('.contact_form').animate({'background-color':'#114411'}, 1000) | |
).bind "ajax:error", (e, xhr, status, error) -> | |
$("#new_contact").append "<p>ERROR</p>" | |
alert "Something went wrong :( try again or contact me by email." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment