if문 쓰는방법 문의 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

if문 쓰는방법 문의 정보

if문 쓰는방법 문의

본문

팝업창뜰때 음성파일을 tmpstr[?] ?에 내용이 0개 이상일경우  Sound.play를 다르게적용하고싶은데요
현재는 팝업이뜨면 Sound.play(g4_path + "/js/recv_mail.mp3"); 만실행중이거든요

re.html에 내용이 잇을경우 Sound.play(g4_path + "/js/re.mp3"); 실행
ex.html에 내용이 잇을경우 Sound.play(g4_path + "/js/exmp3"); 실행
free.html에 내용이 잇을경우 Sound.play(g4_path + "/js/free.mp3"); 실행
one.html에 내용이 잇을경우 Sound.play(g4_path + "/js/one.mp3"); 실행
이런게실행시키는 방법좀 부탁드립니다.




========================================================================

function newArticleCheck() {
$j.post( g4_path+"/ajax.newUpdateCheck.php",
function(data){
tmpstr = data.split("|");
var divToday  = $j('#divToday');
var re = $j(".re_value");
var ex = $j(".ex_value");
var free = $j(".free_value");
var one = $j(".one_value");

if(tmpstr[0] != 0 || tmpstr[1] != 0 || tmpstr[2] != 0 || tmpstr[3] != 0){

divToday.show();

re.html("<font color=red><b>" + tmpstr[1] + "</b></font>");

ex.html("<font color=red><b>" + tmpstr[0] + "</b></font>");

free.html("<font color=red><b>" + tmpstr[2] + "</b></font>");

one.html("<font color=red><b>" + tmpstr[3] + "</b></font>");

Sound.play(g4_path + "/js/recv_mail.mp3");
}else{
divToday.hide();
}
});
}

댓글 전체

될지 안될지는 모르지만 투척하고 갑니다..

if (re.html("<font color=red><b>" + tmpstr[1] + "</b></font>").length){ // .length 로 있는지 없는지 확인
Sound.play(g4_path + "/js/recv_mail.mp3");
}
아래처럼해봣는데 안되네요
4개의 음성파일을 다불러오네요

if (re.html("<font color=red><b>" + tmpstr[1] + "</b></font>").length)
{ // .length 로 있는지 없는지 확인
Sound.play(g4_path + "/js/re.mp3");
}

if (ex.html("<font color=red><b>" + tmpstr[0] + "</b></font>").length)
{ // .length 로 있는지 없는지 확인
Sound.play(g4_path + "/js/ex.mp3");
}


if (free.html("<font color=red><b>" + tmpstr[2] + "</b></font>").length)
{ // .length 로 있는지 없는지 확인
Sound.play(g4_path + "/js/free.mp3");
}

if (one.html("<font color=red><b>" + tmpstr[3] + "</b></font>").length)
{ // .length 로 있는지 없는지 확인
Sound.play(g4_path + "/js/onemp3");
}
다사힌번봐주시면 감사하겟습니다
적용이안되서요



function newArticleCheck() {
$j.post( g4_path+"/ajax.newUpdateCheck.php",
function(data){
tmpstr = data.split("|");
var divToday  = $j('#divToday');
var re = $j(".re_value");
var ex = $j(".ex_value");
var free = $j(".free_value");
var one = $j(".one_value");

if(tmpstr[0] != 0 || tmpstr[1] != 0 || tmpstr[2] != 0 || tmpstr[3] != 0){

divToday.show();

(re.html("<font color=red><b>" + tmpstr[1] + "</b></font>")).length

{ // .length 로 있는지 없는지 확인
Sound.play(g4_path + "/js/re.mp3");
}

(ex.html("<font color=red><b>" + tmpstr[0] + "</b></font>")).length

{ // .length 로 있는지 없는지 확인
Sound.play(g4_path + "/js/ex.mp3");
}


(free.html("<font color=red><b>" + tmpstr[2] + "</b></font>")).length

{ // .length 로 있는지 없는지 확인
Sound.play(g4_path + "/js/free.mp3");
}

 (one.html("<font color=red><b>" + tmpstr[3] + "</b></font>")).length

{ // .length 로 있는지 없는지 확인
Sound.play(g4_path + "/js/one.mp3");
}

}else{
divToday.hide();
}
});
}
헐킈.... 이렇게 하실줄이야 ..ㅋㅋㅋ

if ((re.html("<font color=red><b>" + tmpstr[1] + "</b></font>").length)) { // .length 로 있으면 사운드 플레이
Sound.play(g4_path + "/js/re.mp3");
}

이렇게 하나만 되는지 안되는지 확인해보세요.
if를 4개 사용하지 마시고 if다음에 오는 if는 else if로 해보세요..
앞에껄 충족시키지 못할 경우에만 다음 구문으 실행합니다.
전체 66,558 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT