Guest User

Untitled

a guest
Jul 18th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. def main(request):
  2. page=str(1)
  3. d3 = requests.get('https://d3.ru/api/posts/?sorting=rating&threshold_date=day&page='+page).json()
  4.  
  5. page=str(2)
  6. page=str(3)
  7. page=str(4)
  8.  
  9. $(window).scroll(function () {
  10. if ($(window).scrollTop() + $(window).height() == $(document).height()) {
  11. alert("uzhe dno");
  12. });
  13.  
  14. $.ajax({
  15. url: "{% url 'main' %}",
  16. type: "GET",
  17. //call main
  18. });
  19.  
  20. $(window).scroll(function() {
  21. if($(window).scrollTop() == $(document).height() - $(window).height()) {
  22. // ajax call get data from server and append to the div
  23. }
  24. });
Add Comment
Please, Sign In to add comment