0

In my project I am sending ajax request on success of ajax in done function I have:

window.open('newpage.php');

I am opening this in new tab. I want to pass data to this new page using POST.

I have read you need to do like

<form id="invisible_form" action="new_window.php" method="post" target="_blank">
  <input id="new_window_parameter_1" name="parameter" type="hidden" value="default">
</form>


$('#new_window_parameter_1').val('value');
$('#invisible_form').submit();

but in my example I dont have a form.

How can I open new page while still sending data using POST.

P.S

I dont want to use GET because the data will be seen in the URL and I dont want that.

Pekka
  • 1,075
  • 2
  • 10
  • 17
  • You can only send data with `form ` . Here [my answer](http://stackoverflow.com/questions/40523975/open-window-open-with-post-data-and-get-data-with-php) – Jack jdeoel May 03 '17 at 08:27
  • similar issues found on http://stackoverflow.com/questions/5684303/javascript-window-open-pass-values-using-post – Chris Lim May 03 '17 at 08:47

0 Answers0