title: How to open page in new window and not in same window and on its new tab?
body: <p>When user click a button in main page, My page open in same window as new tab and not open a new window or popup window. Below is my code :  </p>
  
  <pre><code>  var form = document.createElement("form");
      form.setAttribute("method", "post");
      form.setAttribute("action", "popupPage.jsp");
  
      form.setAttribute("target", "view");
  
      var hiddenField = document.createElement("input"); 
      hiddenField.setAttribute("type", "hidden");
      hiddenField.setAttribute("name", "message");
      hiddenField.setAttribute("value", "val");
      form.appendChild(hiddenField);
      document.body.appendChild(form); 
      window.open('', 'view'); 
      form.submit();
  </code></pre>