채택완료

추천누르면 나타나는 숫자를 이모티콘으로 넣고싶습니다

2016-12-12 (월) 23:41:36 4,716

추천버튼을 누르면 옆에 숫자가 나타나는데요 

저는 숫자 말고 폰트어썸이나 이미지를 넣고 싶은데 어떻게 해야될지 모르겠습니다 

            <?php if($board['bo_use_good']) { ?><span>추천 <strong><?php echo number_format($view['wr_good']) ?></strong></span><?php } ?>



 <strong><?php echo number_format($view['wr_good']) ?></strong> 이게 숫자부분인데
저 숫자 대신에 
다른 php코드를 넣을순 없는걸까여?

아래 에이젝스 스크립 부분또한
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"
    );
}
수정을 해야될것 같은데 

$el.find("strong").text(number_format(String(data.count)));

말고 어떻게 수정을 해야 숫자대신 
폰트어썸이나 이미지를 넣을수 있을지 궁금합니다
넣고싶은 폰트는   "<i class="fa fa-star-o" aria-hidden="true"></i>';
별모양이구요 

도움좀 부탁드립니다 ~
|

답변 1개

채택된 답변
+20 포인트

<strong><i class="fa fa-star-o" aria-hidden="true"></i></strong> 

이렇게 하면 안되나요?

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