Regina Miller Regina Miller - 6 months ago 29
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