$(document).ready(function() {
var page = 1;
var getData;
(getData = function() {
$.ajax({
url:'http://darkweb.wapkiz.mobi/page-0.html?to-page=' +page,
type: 'GET',
complete: function (response) {
var html = response.responseText;
if(html) {
$('#result').append(html);
$('#more').text('Load More Post'); //add text "Load More Post" to button again
} else {
$('#more').text('No more Post to load'); // when last record add text "No more posts to load" to button.
}
},
error: function () {
$('#more').text('No more Post to load'); // when last record add text "No more posts to load" to button.
},
});
})();
$('#more').click(function() {
$('#more').html('<img src="http://www.javascriptsource.com/img/ajax-loader.gif"/>');
page += 1;
getData();
});
});
function loadMore() {
$("#loading").html('Loading...').show();
var currPage = 1;
$.get('page-0.html?to-page?=' + currPage, function(html) {
$("#results").append(html); $("#loading").hide(); });
}
$(document).ready(function() {
var currPage = 1;
$("a.next").click(function() {
currPage +=1;
loadMore(currPage);
});
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.