I know how to use $.ajax. I have a Codeigniter project so I just call:
url:\'\',
Do you can try this ? Change the (alert) function with your function
$.ajax({
url: 'test.html',
async: false,
success: function () { alert('hello people from the world'); }
});
Never use async: false. Since Javascript runs on the UI thread, an async: false request will freeze the browser until the server replies