이미 추천 한 글 알터창 대신 추천 할때와 같이 메새지만 출력 하기
그누 원본은 추천을 하고 한번 더 추천 누르면
이미 추천 하신 글 입니다.
알터창이 뜹니다.
알터창 대신 추천 할때와 같이 메세지만 보여주기입니다.
사용하는 view.skin.php 하단 추천 스크립트 수정
[code]
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"
);
}
[/code]
를 아래 와 같이 수정
[code]
function excute_good(href, $el, $tx) {
$.post(
href,
{ js: "on" },
function(data) {
if(data.error) {
$tx.text(data.error);
$tx.fadeIn(200).delay(2500).fadeOut(200);
return false;
}
if(data.count) {
$el.find("strong").text(number_format(String(data.count)));
if($tx.attr("id").search("nogood") > -1) {
$tx.text("이 글을 비추천하셨습니다.");
} else {
$tx.text("이 글을 추천하셨습니다.");
}
$tx.fadeIn(200).delay(2500).fadeOut(200);
}
}, "json"
);
}
[/code]
참고로
[code]
if(data.error) {
alert(data.error);
return false;
}
[/code]
를 아래처럼 수정 한겁니다.
[code]
if(data.error) {
$tx.text(data.error);
$tx.fadeIn(200).delay(2500).fadeOut(200);
return false;
}
[/code]
댓글 10개
수정 전: alert(data.error);
수정 후: $tx.text(data.error); $tx.fadeIn(200).delay(2500).fadeOut(200);
추천 감사합니다.
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4402 | ||
| 2694 | 2개월 전 | 188 | ||
| 2693 | 2개월 전 | 148 | ||
| 2692 | 2개월 전 | 158 | ||
| 2691 | 2개월 전 | 174 | ||
| 2690 | 2개월 전 | 326 | ||
| 2689 | 2개월 전 | 234 | ||
| 2688 |
|
2개월 전 | 441 | |
| 2687 | 2개월 전 | 292 | ||
| 2686 |
선택과집중
|
2개월 전 | 329 | |
| 2685 | 2개월 전 | 291 | ||
| 2684 | 2개월 전 | 346 | ||
| 2683 | 2개월 전 | 481 | ||
| 2682 | 2개월 전 | 276 | ||
| 2681 | 2개월 전 | 302 | ||
| 2680 |
선택과집중
|
2개월 전 | 278 | |
| 2679 | 2개월 전 | 330 | ||
| 2678 |
|
3개월 전 | 429 | |
| 2677 |
|
3개월 전 | 502 | |
| 2676 | 3개월 전 | 326 | ||
| 2675 | 3개월 전 | 304 | ||
| 2674 |
선택과집중
|
3개월 전 | 480 | |
| 2673 |
|
3개월 전 | 322 | |
| 2672 | 3개월 전 | 335 | ||
| 2671 | 3개월 전 | 284 | ||
| 2670 | 3개월 전 | 260 | ||
| 2669 | 3개월 전 | 374 | ||
| 2668 | 3개월 전 | 289 | ||
| 2667 |
선택과집중
|
3개월 전 | 484 | |
| 2666 |
선택과집중
|
3개월 전 | 470 | |
| 2665 |
선택과집중
|
3개월 전 | 404 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기