![]() |
| ||
| pass value in cgi script to javascript I am loading a perl script that creates 2 arrays - 1 with a list of id's for classes offered and another with # of students already registered for each class (from a flat file that already exists) How can I reference the array values generated by the cgi scipt in javascript? Overall task: I have shopping cart function that uses a value called classid I want to read the classid array genereated by perl script If classid value in shopping cart function matches a classid value in classid array get matching element in # of students already registered" array When I say matching, I mean element number or index. Message user that "nn" students have already registered for this class... If javascript could open and read a file on my server... I probably would not need cgi script? |
| ||
| Re: pass value in cgi script to javascript No, javascript on the client machine can't and is not made to read files on the server. It's a client side language though it can be very well used on your server (that would be something rare). To pass values from your server variables to javascript, you would need to dynamically generate the javascript content. In Java, we can do something like this: /* Greet.jsp */ |
| All times are GMT -4. The time now is 10:02 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC