nikmit has asked for the wisdom of the Perl Monks concerning the following question:
Hi guys,
I need to provide a perl array of about 400 elements to javascript code in an html page. I am already using (and learning) Template Toolkit to separate perl from html.
My options as I currently see them:
a) print out the array along with the rest of the js code in the header of the page
b) some suggest JSON should be used for this, I would need to read-up
c) look for a built-in function within Template Toolkit that already does that
d) ...?
I am looking for a balance of code efficiency/speed and ease of use - I'm not a dedicated web developer and don't want to spend weeks learning a language for a small increase in speed... then again if my current knowledge is archaic I don't want to sit in the stone age :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Providing perl array data to javascript code
by Eily (Monsignor) on Nov 19, 2015 at 09:54 UTC | |
|
Re: Providing perl array data to javascript code
by Anonymous Monk on Nov 19, 2015 at 09:52 UTC | |
|
Re: Providing perl array data to javascript code
by Lennotoecom (Pilgrim) on Nov 20, 2015 at 06:27 UTC |