0

我在互联网“投票系统”上找到了一些脚本,我想稍微修改一下,所以我有这段代码:

$.post(
    "voting/voting.php?value="+a, 
    { }, 
    function(response) {
        // now update box bar           
        $.post(
            "voting/update_box.php", 
            { }, 
            function(update){
                $('#update_count').html(unescape(update));              
            }
        );
        ////////////

        // now update tooltip count         
        $.post(
            "voting/update_tooltip.php", 
            { }, 
            function(updates){
                $('.tooltip3').html(unescape(updates));             
            }
        );
        ////////////
    }
);

您在第一行中看到voting/voting.php?value="+a,我想在video其中添加另一个值 - 将存储id当前视频的位置,并将其voting.phpvalue.

我试过这个(我将视频存储id为带有类的 div 的 id .tooltip,我知道这有点奇怪,但我认为它应该可以工作):

var b = $(".tooltip").attr("id");
$.post("voting/voting.php?video="+b+"&value="+a, {

但这不起作用。有什么建议么?

4

1 回答 1

2
$.post("voting/voting.php", {"value":a,"video":b },
function(response)...

这将在POST方法中发送参数。

于 2012-05-14T09:57:16.783 回答