I want to know how to send data using Javascript. This is what I tried so far:
$('A').on("click", function(){
$.ajax({
type:"POST",
url: "/cccc",
data: {user: 'a'},
success: function(response){
alert(response);
},
error: function(data)
{
alert(data.responseText);
},
});
I've tried above ajax function but nothing happens.
Also i curious that if there is more simple function like
$('A').on("click", function(){
post('/cccc', make_params(a:'a')
});
Hope someone can answer above 2 questions! Thanks!