شاید این مطالب را هم دوست داشته باشید
'); // Defining the Status message element var statusdiv=$('#comment-status'); commentform.submit(function(){ // Serialize and store form data var formdata=commentform.serialize(); //Add a status message statusdiv.html('
'); //Extract action URL from commentform var formurl=commentform.attr('action'); //Post Form with data $.ajax({ type: 'post', url: formurl, data: formdata, error: function(XMLHttpRequest, textStatus, errorThrown){ statusdiv.html('
'); }, success: function(data, textStatus){ if(data=="success") statusdiv.html('
'); else statusdiv.html('
'); commentform.find('textarea[name=comment]').val(''); } }); return false; }); });
/* * * Script to simulate loading comments * * E-mail: pereirabi@outlook.com * */
var comments = document.getElementsByClassName("comment"); var numComments = document.querySelectorAll('.comment').length; var counter = numComments - 1; // less the first two = index 0 and 1 var seeMore = document.getElementById('seeMore');
window.onload = function() { if (numComments > 5) { // show see more button seeMore.style.display = 'block'; } }
function loadMore() { var actualValue = (numComments - counter) + 1;
// showing comment for (i = 0; i