A
A
arni_es2015-10-07 10:33:32
JavaScript
arni_es, 2015-10-07 10:33:32

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

4 answer(s)
N
ndbn, 2015-10-07
@arni_es

Place the array in localStorage if it needs to be used directly on the client side.

M
Maxim Martirosov, 2015-10-07
@kalbac

Array PHP or JavaScript?
PHP can be passed either via global global $my_array;or XMLHttpRequest or via session

3
3luyka, 2015-10-07
@3luyka

Ajax.

E
Evgeny Svirsky, 2015-10-07
@e_svirsky

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 question

Ask a Question

731 491 924 answers to any question