채택완료

추천 클릭시 변수값하나더 추가해서 good.php에 넘기기?

예를들어 aaaa라는 변수에 들어있는 값을 아래 소소에 적용해서

 

/bbs/good.php 까지 보내고 싶은데 어디다 추가하면 되나요?

 

 

    // 추천, 비추천
    $("#good_button, #nogood_button").click(function() {
        var $tx;
        if(this.id == "good_button")
            $tx = $("#bo_v_act_good");
        else
            $tx = $("#bo_v_act_nogood");

        excute_good(this.href, $(this), $tx);
        return false;
    });
 

function excute_good(href, $el, $tx)
{
    $.post(
        href,
        { js: "on" },
        function(data) {
            if(data.error) {
                alert(data.error);
                return false;
            }

            if(data.count) {
                $el.find("strong").text(number_format(String(data.count)));
                if($tx.attr("id").search("nogood") > -1) {
                    $tx.text("이 글을 비추천하셨습니다.");
                    $tx.fadeIn(200).delay(2500).fadeOut(200);
                } else {
                   $tx.text("이 글을 추천하셨습니다.");
                    $tx.fadeIn(200).delay(2500).fadeOut(200);
                }
            }
        }, "json"
    );
}
 

 

 

|

답변 1개

채택된 답변
+20 포인트

skin\board\basic\view.skin.php 파일에서 버튼 부분에 보면 아래의 소스가 있습니다.

<a href="<?php echo $good_href.'&amp;'.$qstr ?>"

이 소스보다 위쪽에 아래와 같은 소스를 추가해주면 됩니다.

$qstr .= '&amp;변수명=값';

답변을 작성하려면 로그인이 필요합니다.