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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -