alert ile tekrarlama
bu scroll kodlarim
<script type="text/javascript">
$(function(){
var start = 0;
var limit = 5;
$(window).scroll(function(){
if($(this).scrollTop() === $(".site").height() - $(window).height()){
var mid = $(".id").last().attr("id");
$.ajax({
type: "post",
url: "funksiya.php",
data: {
"mid": mid,
"start": start,
"limit": limit
},
success: function(veri){
if(veri=='bos'){
}else{
$(".contain").append(veri);
start+=limit;
}
}
})
}
});
})
</script>
bu da geri kalan kodlar
<script type="text/javascript">
$(function(){
$(".urek").click(function(){
var urek = $(this);
var id = urek.attr('id');
alert(id);
})
})
</script>
<?php
if($_POST){
$mid = $_POST['mid'];
$start = $_POST['start'];
$limit = $_POST['limit'];
$mehsul = $db->prepare("select * from mehsullar where id < $mid order by id desc limit $start,$limit");
$mehsul->execute();
$say = $mehsul->rowCount();
if($say > 0){
while ($mehsulcek = $mehsul->fetch(PDO::FETCH_ASSOC)) {
$id = $mehsulcek["id"]; ?>
<span class="urek" id="<?php echo $id; ?>"><?php echo $id; ?></span> <?php
}
}else{
echo 'bos';
}
}
bu scroll kodlarim
<script type="text/javascript">
$(function(){
var start = 0;
var limit = 5;
$(window).scroll(function(){
if($(this).scrollTop() === $(".site").height() - $(window).height()){
var mid = $(".id").last().attr("id");
$.ajax({
type: "post",
url: "funksiya.php",
data: {
"mid": mid,
"start": start,
"limit": limit
},
success: function(veri){
if(veri=='bos'){
}else{
$(".contain").append(veri);
start+=limit;
}
}
})
}
});
})
</script>
bu da geri kalan kodlar
<script type="text/javascript">
$(function(){
$(".urek").click(function(){
var urek = $(this);
var id = urek.attr('id');
alert(id);
})
})
</script>
<?php
if($_POST){
$mid = $_POST['mid'];
$start = $_POST['start'];
$limit = $_POST['limit'];
$mehsul = $db->prepare("select * from mehsullar where id < $mid order by id desc limit $start,$limit");
$mehsul->execute();
$say = $mehsul->rowCount();
if($say > 0){
while ($mehsulcek = $mehsul->fetch(PDO::FETCH_ASSOC)) {
$id = $mehsulcek["id"]; ?>
<span class="urek" id="<?php echo $id; ?>"><?php echo $id; ?></span> <?php
}
}else{
echo 'bos';
}
}