Hi,
I beginer in javascript and jquery soo my question about understanding of javascript syntax.
Why in ajax jquery function - should be writen function success:function (){myfun();} and not directly success:myfun() ?
Working:
$.ajax({
type: 'POST',
url: 'http://www.myurl.com',
data: data,
success: function(data) {
alert(data);
}
});
Not Working:
$.ajax({
type: 'POST',
url: 'http://www.myurl.com',
data: data,
success: alert(data)
});
Thanks