Last active
December 26, 2015 02:59
-
-
Save UberNick/7082105 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@include file="/libs/foundation/global.jsp"%> | |
<%@page session="false" %> | |
<sling:include path="<%= componentContext.getResource().getPath() + ".ajax.html" %>" /> | |
<button id="loadMoreButton" style="width:100%; height:35px">Load More</button> | |
<script type="text/javascript"> | |
(function($){ | |
var Bestsellerloader = { | |
queryUrl : "", | |
init:function(queryUrl){ | |
this.queryUrl = queryUrl; | |
var self = this; | |
$("#loadMoreButton").click(function(){ | |
self.load(); | |
$(this).remove(); | |
}); | |
}, | |
load:function(){ | |
$.get(this.queryUrl, {offset: 4, limit: 0}, function(data){ | |
$(".bestsellerloader").append(data); | |
}); | |
} | |
} | |
$(document).ready(function(){ | |
Bestsellerloader.init("<%= componentContext.getResource().getPath() + ".ajax.html" %>"); | |
}); | |
})($CQ); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment