Can I pass an array as a parameter to a page using window.open?
2 answers
JSON can be used. Using JSON.stringify, generate JSON, use JSON.parse to restore an object or array. Through window.location.href and decodeURI, you can get a request with JSON. But we must remember that some browsers may have a limit on the length of the url.
|
I was offered to use session storage. I think it will be much better. And already on the opening page I will parse storage. Thank you all for the help.
- Do not write "Thank you" as an answer. When your reputation reaches the required level, you will be able to vote for questions and answers that you find useful. - fori1ton
|
window.open('index.php?x[1]=1&x[2]=2');
orwindow.open('index.php?x[]=1&x[]=2');
- Serge Seredenko