@Logic_AliMay 08.2008 — #Anybody please tell me how can i use the array of javascript on other page (on action page) ?[/quote]When you say 'action page' presumably you're submitting a form, in which case you can copy the array data into a hidden input, then reconstruct it in the destination document.
@JMRKERMay 09.2008 — #I'm not sure if this will send a large array, but you didn't specify how big it is.
The example uses the same file, 'URLarray.html', but you should be able
to change to the correct file that will collect the passed information.
Just create a string of the elements separated by '&'
and append it to the URL with a '?='.
Code for: URLarrray.html [code=php] <html> <head> <title>Page Array Passage</title> <script language="JavaScript" type="text/JavaScript"> function showloc() { query = '' + this.location; //pulls the URL query = query.substring((query.indexOf('=')) + 1); //removes everything to the left of the = var arr = []; arr = query.split(/&/); var msg = 'Array information passed:<br>'; if (arr.length <= 1) { msg = 'No array information passed by:<br>'; } document.getElementById('info').innerHTML = msg+arr.join('<br>'); }
window.onload=function(){showloc()} //needed to actually load the function </script> </head> <body> URLarray.html page called by: <li><a href="URLarray.html">URLarray.html</a></li> <br> <li><a href="URLarray.html?=1&2&3&4&5&6&7&8&9">URLarray.html?=1&2&3&4&5&6&7&8&9</a></li>
<br> <div id="info"></div> </body> </html> [/code] Once you get the URL string, push to another array or use 'arr' after split.