I am looking at the firetube example and would like to make a change to the limit after a button is pressed, For example a load more button is pressed and a fucntion is called in the firetube.js file. Which needs to increase the query limit so that more items are displayed. How do I go about that? Below is the code I have:
var commentLimit = 10;
//Create a query for only the last 10 comments
var last10Comments = commentsRef.limit(commentLimit);
//Render Comments
last10Comments.on('child_added', function (snapshot) {
var comment = snapshot.val();
var newDiv = $("<div/>").addClass("comment").attr("id",snapshot.name()).appendTo("#comments");
FB.api("/" + comment.userid, function(userdata) {
comment.name = userdata.name;
newDiv.html(Mustache.to_html($('#template').html(), comment));
});
});
And the load more function:
function loadMoreClicked() {
commentLimit = commentLimit + 10;
commentsRef = new Firebase(firebaseURL);
last10Comments = commentsRef.limit(commentLimit);
}