小编bil*_*lla的帖子

将ajax数据发布到PHP并返回数据

如何将一些ajax数据发布到控制器功能并将其恢复?因为我想将一个整数发布到函数中,并获得另一个整数(对于发布ID的项目的总投票数),并且在成功时我想要回显该投票计数.我不知道如何将"id"发布到控制器功能.请看我的代码:

//post this integet
the_id = $(this).attr('id'); 

        $.ajax({
            type: "POST",
            data: the_id,
            url: "http://localhost/test/index.php/data/count_votes",
            success: function(){
                //the controller function count_votes returns an integer.
                //echo that with the fade in here.

                }
            });
Run Code Online (Sandbox Code Playgroud)

php jquery post codeigniter

10
推荐指数
3
解决办法
9万
查看次数

jQuery:在页面中心保留一个div,即使页面向下滚动

我想在屏幕上居中一个div,这样当页面向下/向上滚动时,div会平滑地滚动到页面的中心.我正在尝试这个代码(请参阅jsfiddle),但不起作用.有人可以帮我吗?谢谢.

html javascript css jquery

1
推荐指数
2
解决办法
8589
查看次数

标签 统计

jquery ×2

codeigniter ×1

css ×1

html ×1

javascript ×1

php ×1

post ×1