Replacement function for jQuery .post
I would:


Use a FormData instead of creating a form element. 
Give it a name better than "postR", like... simply "post"?
Add an error handler to the $.ajax call
Unify both $.ajax calls


Pseudo code (Not tested):

function post(url, params, redir = false, callback = null) {
  var formData = new FormData();

  for (var key in params) {
    formData.append(key, value);
  }

  $.ajax({
    type: "POST",
    url: url,
    data: formData,
    success: function(data) {
      typeof(callback) === "function" &amp;&amp; callback(data);
      redir &amp;&amp; window.location.reload();
    }
  });
}