Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
192
rated 0 times [  194] [ 2]  / answers: 1 / hits: 54082  / 10 Years ago, wed, july 23, 2014, 12:00:00

I have a javascript variable called list. I need to send it as a POST data to another page and open that page in a new tab (with the POST data present).



This code:



jQuery.post('datadestination.php', list);


sends the data all right, but ofcourse it opens the page in the same tab.



I saw some solutions to similar problems using invisible form and things like that, but I could not get them to work. Is there any simple solution?


More From » php

 Answers
36

I suggest:



  1. Pass that list with the jquery.post() function and save it in the SESSION array.

  2. Open a new tab with the same file/address/URL with the window.open() function.

  3. Retrieve saved data from the SESSION array.


This seems straightforward and clean to me.


[#70082] Monday, July 21, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
debras

Total Points: 307
Total Questions: 98
Total Answers: 112

Location: Maldives
Member since Tue, Dec 21, 2021
3 Years ago
;