Okay, I didn't do jQuery for a while and I feel like I am doing some really banal mistake, but can't seem to find it.
I'd like to put the html file, using ajax,to my index.php when the document is ready without actually preloading the website.
So, the button in .php file:
<button class="dropposts">Post a Comment..</button>
And the jQuery:
$(document).ready(function() {
$('.dropposts').on('click', function() {
$.ajax({ url: 'comment_form.html',
dataType: 'html',
success: function(response)
{ $('.comment-form').html(response); }
});
}):
}):
This is extremely simple; my file is in the root site folder, in the comment_form.html
to be specific. Now, when I click the button nothing happens. Why? Am I missing something really basic?