페이지 이동 스크립트(alert("메시지","이동할 url"))가 먹히질 않습니다.

페이지 이동 스크립트(alert("메시지","이동할 url"))가 먹히질 않습니다.

QA

페이지 이동 스크립트(alert("메시지","이동할 url"))가 먹히질 않습니다.

본문

이전에 이것 관련해서 몇번 문의를 구햇는데, 해결되지 않아 이렇게 글을 다시 올려봅니다.

 

관리자 게시판에서 사용자들이 글을 올린 글에 대해 답변을 달고 답변 버튼을 누르면

 

상태가 변경되면서 리스트 화면으로 이동을 시키려고 합니다.

 

 

이런 경우 write_update.skin.php에서

 

alert("메시지"); 이런 식으로 되면, 메시지 출력후 뒤로 가기 입니다. 라고 도움을 얻어서

 

alert("메시지", "./board.php?bo_table=&bo_table"); 이렇게 수정을 했는데, 페이지 이동이 전혀 이루어지지 않습니다

 

alert("답변이 완료되었습니다.", "{$https_url}/board.php?bo_table=$bo_table&wr_id=$wr_id&page=$page" . $qstr);

 

이렇게 해서 코드에 넣어봐도 전혀 이동이 되지 않습니다.

 


//write_update.skin.php
if ($g4[https_url])
    $https_url = "$g4[url]/$g4[bbs]";
else
    $https_url = ".";
$sql = " update $write_table set ca_name = '답변완료'
         $sql_password 
       where wr_id = '$wr[wr_id]' "; 
sql_query($sql);
alert("답변이 완료되었습니다.", $https_url."/board.php?bo_table=$bo_table");

 


//write.skin.php 
<?
$body_mode = "pop";
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if ($is_dhtml_editor) {
    include_once("$g4[path]/lib/cheditor4.lib.php");
    echo "<script src='$g4[cheditor4_path]/cheditor.js'></script>";
    echo cheditor1('wr_content', '100%', '250');
}
$updatetime=date('Y-m-d H:i:s');
?>
<script language='Javascript' src='<?=$board_skin_path?>/sms.js'></script>
        <form name="fwrite" method="post" onsubmit="return fwrite_submit(this);" enctype="multipart/form-data" target='hiddenframe'>
        <input type=hidden name=null> 
        <input type=hidden name=w        value="<?=$w?>">
        <input type=hidden name=bo_table value="<?=$bo_table?>">
        <input type=hidden name=wr_id    value="<?=$wr_id?>">
        <input type=hidden name=sca      value="<?=$sca?>">
        <input type=hidden name=sfl      value="<?=$sfl?>">
        <input type=hidden name=stx      value="<?=$stx?>">
        <input type=hidden name=spt      value="<?=$spt?>">
        <input type=hidden name=sst      value="<?=$sst?>">
        <input type=hidden name=sod      value="<?=$sod?>">
        <input type=hidden name=page     value="<?=$page?>">
        <input type=hidden name=secret     value="secret">
        <input type=hidden name=wr_1     value="<?=$write[wr_1]?>">
    <div style='float:left;width:300px;'>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class=brd_col>
            <colgroup width=80 />
            <colgroup width='' />
            <? if ($is_name) { ?>
            <tr>
                <td class=brd_col1><img src='/images/bbs/field_name.gif'></td>
                <td class=brd_col2><input class='box01' maxlength=20 size=15 name=wr_name itemname="이름" required value="<?=$name?>"></td>
            </tr>
            <? } ?>
            <? if ($is_category) { ?>
            <tr>
                <td class=brd_col1>상태</td>
                <td class=brd_col2><select name=ca_name required id="ca_name" itemname="분류"><option value="">선택하세요<?=$category_option?></select></td>
            </tr>
            <? } ?>
            <tr style='display:none;'>
                <td class=brd_col1>나이</td>
                <td class=brd_col2><input class='box01' style="width:100%;" name=wr_1 id="wr_1" itemname="나이" required value="<?=$write[wr_1]?>"></td>
            </tr>
            <tr style='display:;'>
                <td class=brd_col1>핸드폰번호</td>
                <td class=brd_col2><input class='box01' style="width:100%;" name=wr_subject id="wr_subject" itemname="핸드폰번호" required value="<?=$subject?>" readonly></td>
            </tr>
            <tr style='display:;'>
                <td class=brd_col1>질문내용</td>
                <td class=brd_col2><!-----<textarea class='box01' style="width:116px;height:120px;border:none;" name=wr_content id="wr_content" itemname="제목" required value="" readonly><?=$content?></textarea>----->
                    <div style='float:left;' class='box01'><textarea style='float:left;margin:10px;width:93px;height:93px;background-color:transparent;overflow:hidden;border:none;' name=wr_content id="wr_content" itemname="제목" required readonly><?=$content?></textarea></div>
                </td>
            </tr>
        </table>
    </div>
    <div style='float:left;width:150px;margin-left:15px;'>
        <div style="margin:auto; width:140px; background-color:#F8F8F8; border:1px solid #ccc; text-align:center; margin-bottom:5px;">
            <div style="margin:auto; background-image:url('/admin/sms_admin/img/smsbg.gif'); width:120px; height:120px; margin-top:8px;text-align:center;">
                <textarea id="wr_10" name="wr_10"  style="font-family:굴림체; color:#000; line-height:110%;margin:auto; margin-top:20px; overflow: hidden; width:116px; height:88px; font-size: 9pt; border:0; background-color:transparent;" cols="16" itemname="답변"  class='lcd' <? if(!$write[wr_10]){?>onclick='NSMS_doClear(this)' onselect='NSMS_doClear(this)' onkeyup='NSMS_calByte(this)'<?}else{?>readonly<?}?> 
            <? if ($write_min || $write_max) { ?>onkeyup="check_byte('wr_10', 'char_count');"<?}?>><?=$write[wr_10]?></textarea>
        
            </div>
            <div style="text-align:center; margin:5px 0 5px 0;"><span id=msgByte>0</span> / 2000 byte</div>
        </div>
        <div style='float:left;width:145px;clear:both;'>
            <div>
                <b>회신번호</b>
                <input type=text name=wr_9 id=wr_9 required itemname='회신번호' style="width:90px;" maxlength=20 value="<?=$config[cf_1]?>" class='box02' readonly>
                <input type=text name=wr_8 id=wr_8 value="<?=$updatetime?>">
            </div>
            <? if(!$write[wr_10]){?>
            <div style="text-align:center; margin-top:5px;">
                <input type=submit id="btn_submit" class=btn1 tabindex=6 value='  전 송 하 기  ' style="width:100%; height:30px;" accesskey='s' align='absmiddle'>
            </div>
            <?}?>
        </div>
        <div class='board_button'>
            <input type=submit id="btn_submit" class=btn1 value='답변완료' accesskey='s' align='absmiddle'style="width:70px; height:30px;"> 
            <input type=button class=btn1 value='목록으로' align='absmiddle'style="width:70px; height:30px;" onClick='location.href="./board.php?bo_table=<?=$bo_table?>";'> 
        </div>
    </div>
</form>
<script type="text/javascript">
<?
// 관리자라면 분류 선택에 '공지' 옵션을 추가함
if ($is_admin) 
{
    echo "
    if (typeof(document.fwrite.ca_name) != 'undefined')
    {
        document.fwrite.ca_name.options.length += 1;
        document.fwrite.ca_name.options[document.fwrite.ca_name.options.length-1].value = '공지';
        document.fwrite.ca_name.options[document.fwrite.ca_name.options.length-1].text = '공지';
    }";
} 
?>
with (document.fwrite) 
{
    if (typeof(wr_name) != "undefined")
        wr_name.focus();
    else if (typeof(wr_subject) != "undefined")
        wr_subject.focus();
    if (typeof(ca_name) != "undefined")
        if (w.value == "u")
            ca_name.value = "<?=$write[ca_name]?>";
}
function fwrite_submit(f) 
{
    if (document.getElementById('tx_wr_content')) {
        if (!ed_wr_content.outputBodyText()) { 
            alert('내용을 입력하십시오.'); 
            ed_wr_content.returnFalse();
            return false;
        }
    }
    var subject = "";
    var content = "";
    $.ajax({
        url: "<?=$board_skin_path?>/ajax.filter.php",
        type: "POST",
        data: {
            "subject": f.wr_subject.value,
            "content": f.wr_content.value
        },
        dataType: "json",
        async: false,
        cache: false,
        success: function(data, textStatus) {
            subject = data.subject;
            content = data.content;
        }
    });
    document.getElementById('btn_submit').disabled = true;
    
    document.getElementById('ca_name').value = "답변완료";
    
    <?
    if ($g4[https_url])
        echo "f.action = '$g4[https_url]/$g4[bbs]/write_update.php';";
    else
        echo "f.action = './write_update.php';";
    ?>
    return true;
    //setOrder();
}
</script>
<script language="JavaScript" src="<?="$g4[path]/js/board.js"?>"></script>
<script language="JavaScript"> window.onload=function() { drawFont(); } </script> 

 

 

이 질문에 댓글 쓰기 :

답변 2

전혀 이동이 없다는 것이 흰페이지만 나온다는건가요?

아니면 다른 페이지로 간다는거인가요? 

alert('메시지')만 사용하면 메시지 출력 후 history.go(-1),

alert('메시지','url')을 사용하면 메시지 출력 후 url로 이동을 하게 되어 있는데 메시지만 출력되고 페이지 이동 없이 그 페이지에서 가만히 있는 상태를 애기하는 것입니다.

답변을 작성하시기 전에 로그인 해주세요.
전체 36
QA 내용 검색

회원로그인

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