I have a CGI script, I want to enter a valus from perl hash table to java script var tt. (I mentioned in the code what works and what does not)
perl:
%devices;
push @{$devices{$entity} }, $fname;
js:
\$('#example tr').click(function(){
\$(this, 'tr').each(function(index, tr) {
var lines = \$('td', tr).map(function(index, td) {
return \$(td).text();
});
var d = lines[0];
var test = '@{$devices{'192.116.153.32'}}'; // working
var tt = '\@\{\$devices{' + "\'" + d + "\'" + "\}\}"; // Not working
alert(tt);
The Alert will print something like:
{"192.116.153.32":["examle1.txt","examle2.txt",...]}
$.