in reply to jquery scripts
A templating system can be used to construct a Perl-friendly string containing the necessary data ... but also, this is essentially what the JSON format already is. (Originally, the idea behind JSON was that a JavaScript client could simply eval the string, but those innocent days are gone now.)
It is impossible for you to refer to a Perl variable, such as $mydata, in the web-page text that you send to the client, because the client has no idea where the web-page came from and has no access at all to the (Perl) software that may have produced it. Directly or indirectly, it must see a JavaScript statement that it can correctly parse and execute. The (Perl) server must use the content of its (Perl) variable to generate syntactically-correct and executable JavaScript literals.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: jquery scripts
by marto (Cardinal) on Oct 13, 2015 at 08:49 UTC | |
by jdporter (Paladin) on Oct 14, 2015 at 01:32 UTC | |
|
Re^2: jquery scripts
by hermit23 (Initiate) on Oct 13, 2015 at 08:19 UTC |