Skip to content

Instantly share code, notes, and snippets.

@Punkoivan
Created September 29, 2018 21:41
Show Gist options
  • Save Punkoivan/3360fcdc884513cd203c39b6b8a37c55 to your computer and use it in GitHub Desktop.
Save Punkoivan/3360fcdc884513cd203c39b6b8a37c55 to your computer and use it in GitHub Desktop.
$(document).ready(function(){
$(".button").click(function(){
var number = $(".field_with_number").text();
var address = $(".field_with_address").text();
$.ajax({
type: "POST",
url: "/settings/setmin",
data: {min: number, addr: address},
dataType: "html",
contentType: "application/json;charset=utf-8",
success: function(){
alert("success!");
}
});
});
});
@Punkoivan
Copy link
Author

sample code for fail:

  fail: (function() {
    alert( "error" );
  })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment