Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function loadPostsSearch(searchString) {
- $.ajax({
- type: 'GET',
- data: { searchQuery: '"' + searchString + '"', amount: 5, offset: offset, onlyPostCount: false },
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- url: 'http://kekxd.azurewebsites.net/KekService.asmx/getPostsBySearchJSON',
- success: function (response) {
- offset += 5;
- var responseObj = JSON.parse(response.d);
- addPosts(responseObj);
- if (offset > postnum && postnum > 0) {
- $("#loadMore").hide();
- }
- },
- error: function (a) {
- console.log(a.responseText);
- }
- });
- }
- function loadPosts() {
- $.ajax({
- type: 'GET',
- data: { amount: 5, offset: offset },
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- url: 'http://kekxd.azurewebsites.net/KekService.asmx/getPostsByDateJSON',
- success: function (response) {
- offset += 5;
- var responseObj = JSON.parse(response.d);
- addPosts(responseObj);
- if (offset > postnum && postnum > 0) {
- $("#loadMore").hide();
- }
- },
- error: function (a) {
- console.log(a.responseText);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement