I just trying to load a simple html page with ajax.
$("h1").click(function() {
$.ajax({
type: 'POST',
url: 'ajax.html',
success: function(response) {
$('#buttonGroups').html(response);
alert('Load was performed.');
}
});
})
But I never get the alert..? What am I missing?
You are using the response as an HTML so you need tell that to jquery:
$("h1").click(function() {
$.ajax({
type: 'POST',
url: 'ajax.html',
dataType: "html", // <====
success: function(response) {
$('#buttonGroups').html(response);
alert('Load was performed.');
}
});