Open popup window with post request data in Javascript

 Open popup window with post request data using javascript:
  function openWindowWithPostRequest() {
           var winName='MyWindow';
           var winURL='search.action';
           var windowoption='resizable=yes,height=600,width=800,location=0,menubar=0,scrollbars=1';
           var params = { 'param1' : '1','param2' :'2'};           
           var form = document.createElement("form");
           form.setAttribute("method", "post");
           form.setAttribute("action", winURL);
           for (var i in params) {
                 if (params.hasOwnProperty(i)) {
                     var input = document.createElement('input');
                     input.type = 'hidden';
            = i;
                     input.value = params[i];
 '', winName,windowoption);
  = winName;

Popular posts from this blog

Android: where to run keytool command in android

Can not connect to git using ssh (Permissions 0644 for '/root/.ssh/id_rsa' are too open.

Upload file on Google cloud storage using Java servlet on google app engine