インターネットの「投票システム」でスクリプトを見つけました。少し変更したいので、次のコードを使用します。
$.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.php
value
私はこれを試しました(私はクラスid
でdivのIDとしてビデオを保存し.tooltip
ています、私はそれが少し奇妙であることを知っています、しかし私はそれがうまくいくはずだと思います):
var b = $(".tooltip").attr("id");
$.post("voting/voting.php?video="+b+"&value="+a, {
しかし、これは機能しません。助言がありますか?