'Comment'에 해당되는 글 1건

  1. 2009.07.28 [Ajax] Ajax.request

[Ajax] Ajax.request

JSP 2009. 7. 28. 11:03
Prototype을 사용한 Ajax

window.onload = handleEvent;

function handleEvent() {
    $('comment').observe('click',replyValidate);//success
    $('commentForm').observe('submit',submitReply);//success...but....
}

function submitReply(event) { //fail
    var url = '/comment.do';
   
    new Ajax.Request(
        url,
        {//ajax.option
            parameters: $('commentForm').serialize(true),//transport parameter
            //ajax.callback
            onSuccess: function(transport){
            $('comment_load_area').innerHTML = transport.responseText;
            },
            onFailure: function() {
            alert("전송에 실패하였습니다.");
            }
        }
        );//Ajax.Request
    Event.stop(event);//리소스 전송 차단
}

안된다.

대충 감이 온다.

왜 안되는지를...
Posted by zeide
,