Answer the question
In order to leave comments, you need to log in
How to pass a javascript array to another page?
There are pages: 1.php and 2.php
1.php has an array that needs to be passed by reference to 2.php
Answer the question
In order to leave comments, you need to log in
Place the array in localStorage if it needs to be used directly on the client side.
Array PHP or JavaScript?
PHP can be passed either via global global $my_array;
or XMLHttpRequest or via session
Add an array to the markup and on another page - take it with javascript:
<div data-array="['example', 2, false]">
...
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question