ajax기초에 대해 질문드립니다...

ajax기초에 대해 질문드립니다...

QA

ajax기초에 대해 질문드립니다...

본문

http://wnghks2516.cafe24.com/gnuboard5/bbs/code_view.php?mb_id=admin&wr_id=1&wr_1=2

 

2009340085_1583220755.1603.png

 

 

2009340085_1583220730.0393.png

 


  <select name="theme_select" id="theme_select" class="theme_select">
<? while($row = mysqli_fetch_array($result)){?>
<option value="<?=$row['No']?>"><?=$row['class_theme']?></option>
<?}?>
 </select>
           <input type="text"  id="tete" class="tete">
 <script>
                  var theme_selection = $("#theme_select option:checked").text();
                        alert(theme_selection);
                        $("#theme_select").change(function () {
                        alert($(this).children("option:selected").text());
                                $('#tete').html('');
                                 $.ajax({
                                  url: 'ajax.code.php',
                                  dataType: 'json',
                                  type: 'POST',
                                 data: {'theme_select': $('#theme_select').val()},
                                 success: function(result){
                                    if(result['tete']==true){                                                                                                           $('#tete').html(result['theme_select']);        
                                        }
                                  }
                         });
                   });                           
                                                                </script>
 
<!-----------------------ajax.code.php--->
<?php
echo json_encode(array('tete'=>true, 'theme_select'=>$_REQUEST['theme_select']));
?>

 

ajax를 처음하다보니 이해가 잘 안되서 질문드립니다...

분명 관리자도구로 봤을 때 값을 넘어가는데 input text밖에 값이 생겼고, 어떻게 수정하면 좋을 지 알려주셨으면 합니다....

이 질문에 댓글 쓰기 :

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

회원로그인

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