Skip to content

Instantly share code, notes, and snippets.

@TheOpenDevProject
Created June 29, 2015 02:48
Show Gist options
  • Save TheOpenDevProject/066cc73936e432539822 to your computer and use it in GitHub Desktop.
Save TheOpenDevProject/066cc73936e432539822 to your computer and use it in GitHub Desktop.
app.js
MyApp = {
Events : {
CreateButton_Clicked : $(document).on("click",function(){
$("#CreateButtonID").on("click",function(event){
var PostDataASJson = {
Member : $("#inputid").val()
}
$.ajax({
url: "/Url/To/Controller/",
type: 'POST',
dataType: 'html',
contentType: "application/json; charset=utf-8",
data: JSON.stringify(postData),
success: function (returnData) {
alert("It worked")
},
error: function (jqXHR, textStatus, errorThrown) {
alert('epic fail');
}
});
})
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment