출처 : http://www.tested.co.kr/board/Study/view/wr_id/24/sca/2

Post 이동

function post_to_url(path, params, method) {

    method = method || "post"; // Set method to post by default, if not specified.

 

    // The rest of this code assumes you are not using a library.

    // It can be made less wordy if you use one.

    var form = document.createElement("form");

    form.setAttribute("method", method);

    form.setAttribute("action", path);

 

    for (var key in params) {

        var hiddenField = document.createElement("input");

        hiddenField.setAttribute("type", "hidden");

        hiddenField.setAttribute("name", key);

        hiddenField.setAttribute("value", params[key]);

 

        form.appendChild(hiddenField);

    }

 

    document.body.appendChild(form);

 

    //$("#GetPostXml").val(params);

 

 

    form.submit();

    return false;

}

post_to_url("/", { "GetPostXml": xml });


 

Post 전송, 결과값 리턴

$.post(path, params, function(req) {…});

$.post("/GenSave.aspx", { "GetPostXml": xml }, function(req) {…});

 





















Posted by motolies
,