1

hello all currently i am using infinite scroll which just appends the data of the next page but it dosent shows the current page no .

i want something which can show me the current page no in url .

if i am not very clear to you, you can check this site and see that in action when you scroll the page no changes dynamically.

http://weheartit.com/?page=6

currently i am using code like : if any one just give an idea please ....

and yes i am using php.

here is my javascript

$(document).ready(function(){
 var page = 1;
 var height=$("#forheight").height(); // 100% of window height
$(window).scroll(function () { 
            if($(window).scrollTop() + height == $(document).height()) {
            document.getElementById('infiscroll').style.display="block";
                page++;
                var data = {
                    requested_page: page
                };
                var actual_count = "<?php echo $totaladds; ?>";
                if((page-1)* 10 > actual_count){
                    $("#showmore").fadeOut();
                    document.getElementById('infiscroll').style.display="none";
                }
                else
                {
            $("#showmore").fadeIn();
                $.ajax({
                      type: "POST",
                      url: "scrolladds.php",
                      data:data,
                      success: function(res) {
                         $("#mainofad").append(res);
                        document.getElementById('infiscroll').style.display="none";
                       }
                     });
                  }
                }
             });
       });
Chandan Kumar
  • 4,570
  • 4
  • 42
  • 62
user3159415
  • 17
  • 1
  • 6
  • heres a link on so about how you can use javascript to modify the url http://stackoverflow.com/questions/824349/modify-the-url-without-reloading-the-page – brendosthoughts Jan 16 '14 at 02:26

0 Answers0