javascript - A simple jQuery/AJAX query -
okay, didn't jquery while , feel doing banal mistake, can't seem find it.
i'd put html file, using ajax,to index.php when document ready without preloading website.
so, button in .php file:
<button class="dropposts">post comment..</button>
and jquery:
$(document).ready(function() { $('.dropposts').on('click', function() { $.ajax({ url: 'comment_form.html', datatype: 'html', success: function(response) { $('.comment-form').html(response); } }); }): }):
this extremely simple; file in root site folder, in comment_form.html
specific. now, when click button nothing happens. why? missing basic?
there syntax error in code, used :
instead of ;
$(document).ready(function() { $('.dropposts').on('click', function() { $.ajax({ url: 'comment_form.html', datatype: 'html', success: function(response) { $('.comment-form').html(response); } }); });//changed here }); //changed here
Comments
Post a Comment