﻿
function post_to_url(path, params) {
    var myForm = document.createElement("form");
    myForm.setAttribute("method", "post");
    myForm.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]);

        myForm.appendChild(hiddenField);
    }

    document.body.appendChild(myForm);
    myForm.submit();
    document.body.removeChild(myForm);
}
