in reply to Re: Perl CGI w/ Javascript
in thread Perl CGI w/ Javascript

Ok I added the if and thank you for pointing that out however I come out with the same results. Any other ideas? I will check out HTML::Template.

Replies are listed 'Best First'.
Re3: Perl CGI w/ Javascript
by dragonchild (Archbishop) on Oct 13, 2003 at 23:38 UTC
    Here's the rub - If you move to HTML::Template, the Javascript is now in a text file. More importantly, it's in a text file you can test without the use of Perl. So, you can get your Javascript right, THEN add in the Perl code.

    What I mean is that you build your HTML file and get it right with mocked up data. Then, you replace the mocked up piece with data from your script. But, by that point, you will know the Javascript is correct, so you don't have worry about it.

    ------
    We are the carpenters and bricklayers of the Information Age.

    The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

    ... strings and arrays will suffice. As they are easily available as native data types in any sane language, ... - blokhead, speaking on evolutionary algorithms

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Re: Re: Re: Perl CGI w/ Javascript
by inman (Curate) on Oct 14, 2003 at 10:59 UTC
    As a general point, I would remove the JavaScript to a seperate js file which is refered to in the head section of your HTML file using a <SCRIPT SRC="myscript.js" /> tag. This adds a little more useful code / presentation seperation which improves your ability to test and may lead you to produce reusable code.

    inman