简体   繁体   中英

data posting with infinite scroll

I have a code structure as follows;

<script>

$(document).ready(function mmk'.$imageid.' (){

 $(document).on("click", ".like'.$imageid.'", function(){

  $.post("",{pid:$(this).attr("id"),action:"like'.$imageid.'"},function(){


   });

 });
});
</script>

$pid=$_POST['pid'];
$action=$_POST['action'];


if ($action=='like'.$imageid.''){

....//mysql operations//.....

}

there is a problem related with infinite scroll because in normal page I can post data to both of variables ($pid and $action). But, in loaded page for more content I can not post data to variables with same code structure.

what should I do to solve this problem? if you help, I would be appreciate

It's a common issue on infinite scroll. I think there's nothing to do.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM