CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
how to pass a hash table from perl to javascript function?

 



aurora
Novice

May 15, 2012, 1:03 AM

Post #1 of 2 (802 views)
how to pass a hash table from perl to javascript function? Can't Post

hello all, plaese tell me how can i pass a hash table to the javascript from a perl function as an arguments?

i'm trying as below...in perl function hash table sent as an argument, in javascript it is receiving as below....but its not working,,,,


Code
 HashRowUnit=argv[1];  

alert('size of hash table ' +HashRowUnit.length);


for (var k in HashRowUnit) {
if (HashRowUnit.hasOwnProperty(k)) {
alert('key is: ' + k + ', value is: ' + HashRowUnit[k]);} }



(This post was edited by aurora on May 15, 2012, 1:06 AM)


rovf
Veteran

May 16, 2012, 12:41 AM

Post #2 of 2 (767 views)
Re: [aurora] how to pass a hash table from perl to javascript function? [In reply to] Can't Post

By marshalling. You would write a textual representation of the hash to a file, pass the filename to your Javascript function, and have it parsing the file.

Of course the more you know about the content of your hash, the easier it will be to implement.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives