Regina Miller Regina Miller -3 years ago 109
Ajax Question

how to make a ajax div just text

i wish to make this line $(".load-more").text("No more."); text only not clickable link like load more.

how can i get that to happen if someone could help

<script type="text/javascript">
// Load more data
var row = Number($('#row').val());
var catid = Number($('#catid').val());
var allcount = Number($('#all').val());
row = row + <?php echo $records_per_page; ?>;
if(row <= allcount){
url: '<?php echo DIR; ?>getCat.php',
type: 'post',
data: {row:row,catid:catid},
success: function(response){
// Setting little delay while displaying new content
setTimeout(function() {
// appending posts after last post with class="post"
var rowno = row + <?php echo $records_per_page; ?>;
// checking row value is greater than allcount or not
if(rowno > allcount){

// Change the text and background
$(".load-more").text("No more.");
$(".load-more").text("Load more.");
}, 2000);
// Setting little delay while removing contents
setTimeout(function() {
// When row is greater than allcount then remove all class='post' element after 3 element
// Reset the value of row
// Change the text and background
$('.load-more').text("Load more");
}, 2000);

i am not too familiar with ajax so hope you guys do not mind helping out in it.


Answer Source


$(".load-more").text("No more.");

put this:

$('.load-more').css( 'pointer-events', 'none' );
$('.load-more').click(function(){return false;});
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download