n3mesis125 Posted June 18, 2008 Share Posted June 18, 2008 Hi, is it possible to pass a php array to javascript so that it can then be passed via window.open? IE: $test = array( 'name' => "cat", 'day' => "2008-06-01"); The above would be the array, how could I some how serialize that and pass it through window.open in javascript or is it even possible? Thanks, n3m. Link to comment https://forums.phpfreaks.com/topic/110751-pass-php-array-to-javascript-and-then-to-windowopen/ Share on other sites More sharing options...
ag3nt42 Posted June 18, 2008 Share Posted June 18, 2008 you could just pass the variables via the GET method and not have to wory about the js. I had a case where I needed to populate data into a popup window.. that i used JS to create. but then passed the variables through the URL and picked them up on the other side. with popup.php use a for loop or like to ease the headache of all the array variables. hope that helps.. :-\ Link to comment https://forums.phpfreaks.com/topic/110751-pass-php-array-to-javascript-and-then-to-windowopen/#findComment-568220 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.