in reply to Re^2: Separate Javascipt code from pure Perl code
in thread Separate Javascipt code from pure Perl code
ps. Do the javascript files are the first thing that gets executed when index.pl loads? if yes, by what order?
Yes, JavaScript is parsed and executed at load time. And it is executed in the order it appears.
And also if they are then how do they contain the correct value of $data showing in the following code, which is presented later on index.pl?!?
Simple - they don't. If you want to assign data to a JavaScript variable with the technique I showed you, the data must be available beforehand. Once you have output your start_html, the data you aquire later in your script doesn't travel after the output already written, overtaking it and magically inserting itself into the place you want it to be. You will have to re-organize your index.pl.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |