다른페이지 불러와서 기존inlude페이지 교체하기

다른페이지 불러와서 기존inlude페이지 교체하기

QA

다른페이지 불러와서 기존inlude페이지 교체하기

답변 1

본문

'변경'버튼 클릭시 #includepage 에 

새로운 페이지를 불러와서 교체하는 소스(https://sir.kr/g5_tip/11354)입니다.

그런데 <form> 안에서 아래와 같이 페이지 불러오는 것을 사용하려는데

폼 안에서 클릭시 mov2.php 불러오기가 안되는데 form에서는 ajax가 안되는건가요?

아니면 다른 문제일까요?

 


<form name=frm method=post action="<?=$g5['path']?>/bbs/write_update_nonecapcha.php" onsubmit="return checkFrm(this);">
.
.
.
 
<a href="javascript:void(0);" onclick="btnclick('mov2.php')">변경</a>
<div id="includepage"><?php include('mov1.php'); ?></div>
        
<script type="text/javascript">
    function btnclick(_url){
        $.ajax({
            url : _url,
            type : 'post',
            success: function(data) {
                $('#includepage').html(data);
            },
                error: function() {
                $('#includepage').text('페이지 점검중 입니다.');
            }
        });
    }
</script>
.
.
.
</form>

이 질문에 댓글 쓰기 :

답변 1

mov2.php에 풀 path를 넣어 보세요

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
filter #ajax ×
전체 406
© SIRSOFT
현재 페이지 제일 처음으로