Last active
May 6, 2016 16:20
-
-
Save shoken0x/cdbeb77c13baab51013a682b3c7f4b71 to your computer and use it in GitHub Desktop.
invrement data-offset by click button
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
<html> | |
<head> | |
</head> | |
<body> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function(){ | |
$('#more_load').bind('click', function() { | |
var offset = $(this).data('offset'); | |
var limit = $(this).data('limit'); | |
alert(offset); | |
$(this).data('offset', offset + limit); | |
history.replaceState('','','/top' + '?offset=' + offset + '&limit=' + limit); | |
}); | |
}); | |
</script> | |
<button id="more_load" data-offset="4" data-limit="10">more load</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment