I crack Photoshop!
Posts: 3
24 credits Members referred : 0
« Reply #3 on: Oct 03, 2008, 01:42:26 pm »
you can pass it using urls code like by placing the questions marks at the end of the urls..
« Last Edit: Oct 06, 2008, 05:38:29 pm by Nikolas »
My name is Bong, James Bong
Posts: 11
80 credits Members referred : 0
« Reply #4 on: Apr 18, 2009, 01:26:11 pm »
Quote from: alisha0512
Please anybody tell me that how can i pass the data between javascript pages?
Could you be more specific. What are you trying to achieve ?! Do you want one js variable to be available in some other web page ?
OMG!I am geek
Posts: 56
372 credits Members referred : 0
« Reply #5 on: Apr 05, 2011, 02:11:00 pm »
JavaScript page has retrieved some information from the user. Now you want to display another JavaScript page, which should also use that information. How do you pass it from the first page to the second? There are three simple solutions. The first two are safe and effective, with advantages and disadvantages to each.
Bill Gates is my home boy
Posts: 651
4740 credits Members referred : 0
« Reply #6 on: Jun 08, 2011, 07:36:35 pm »
You could pass the data using body tags. If the case is passing data between JS page to another JS page.
Affiliate Programs CPA Network Affiliate Network
I wish I was an Oscar winner
Posts: 90
580 credits Members referred : 0
« Reply #7 on: Jun 12, 2011, 07:07:35 am »
Im also new to Java can any one help
Just another rainy day
Posts: 1
6 credits Members referred : 0
« Reply #8 on: Jun 28, 2011, 10:25:23 am »
i am also new to that..
Sandwich Artist
Posts: 25
174 credits Members referred : 0
« Reply #9 on: Aug 18, 2011, 11:21:05 am »
passdata1a.html
<script> var data = new Array(); data[0] = "one, a datum"; data[1] = "two, a deer"; data[2] = "three, a slash: \\"; data[3] = "four has quotes: \"I forget what four was for\""; </script> <form name="data" method="POST" action="passdata1b.php"> <input type="hidden" name="data"> </form> <script> function sendData() { // Initialize packed or we get the word 'undefined' var packed = ""; for (i = 0; (i < data.length); i++) { if (i > 0) { packed += ","; } packed += escape(data[i]); } document.data.data.value = packed; document.data.submit(); } </script> <h1>This is what the array contains:</h1> <ul> <script> for (i = 0; (i < data.length); i++) { document.write("<li>" + data[i] + "</li>\n"); } </script> </ul> <a href="javascript:sendData();">Go to passdata1b.php</a>
passdata1b.php
<?php $packed = $_POST['data']; $data = split(",", $packed); for ($i = 0; ($i < count($data)); $i++) { # Undo what JavaScript's escape() function did $data[$i] = rawurldecode($data[$i]); # Slashes need escaping when they appear in code $data[$i] = str_replace("\\", "\\\\", $data[$i]); # Quotes need escaping too $data[$i] = str_replace("\"", "\\\"", $data[$i]); } ?> <script> var data = new Array ( <?php for ($i = 0; ($i < count($data)); $i++) { if ($i > 0) { echo ",\n"; } echo " \""; echo $data[$i]; echo "\""; } ?>
); </script> <h1>This is what the data contains:</h1> <ul> <script> for (i = 0; (i < data.length); i++) { document.write("<li>" + data[i] + "</li>\n"); } </script> </ul>
Cyberpunk Wannabe
Posts: 44
300 credits Members referred : 0
« Reply #10 on: Aug 18, 2011, 11:33:18 am »
Sounds like this would be far more easily done using CGI (make the form action a cgi script. This will pick up the details passed and generate a dynamic page containing them)
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7901