Skip to content

Instantly share code, notes, and snippets.

@guinslym
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guinslym/9457614 to your computer and use it in GitHub Desktop.
Save guinslym/9457614 to your computer and use it in GitHub Desktop.
coffeescript
$(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."
$(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