* button onclick 시 2개 event 처리 할때 다른 jsp 수행 후 table에서 다른 td에 값 뿌려줄때


<table 영역>

<table border="1" cellspacing="0" cellpadding="0"  frame=border  width=100%>

<tr>

<td colspan="2" bgcolor="#000000" style="text:#FFFFFF" >제품 ID 생성</td>

</tr>

<tr>

<td><button type="button" class="btn btn-default btn-lg" 

onclick="httpGetAsync('../user/w_input_create.jsp', myCallBack) ">

<img src="../img/create_01.png" width="100%" ></button></td>

<td id="test1">test</td>

</tr>

</table>




<Script 영역>

<script type="text/javascript">


function httpGetAsync(theUrl, callback)

{

    var xmlHttp = new XMLHttpRequest();

    xmlHttp.onreadystatechange = function() {

        if (xmlHttp.readyState == 4 && xmlHttp.status == 200){

        callback(xmlHttp.responseText);

        }           

    }

    xmlHttp.open("GET", theUrl, true); // true for asynchronous

    xmlHttp.send(null);

}

function myCallBack(response){

        alert(response);

        var getTag="../user/w_input_select.jsp";

        

        $("#test1").load(getTag);

        

        

}


</script>

+ Recent posts