"Moreno, Javier" <[EMAIL PROTECTED]> wrote:
Hi all,

I started migrating my CGIs to use CGI.pm. Everything was fine except
for some additional text that popped up on the _javascript_ section. Does
anyone know what could I be doing wrong? I tried quoting the 'EndOfMark'
but it didn't work either so I had to escape the @s to avoid compilation
issues.

Javier,

Using the CGI.pm feature of -script =>
as a parameter to start_html() is not optimal in your situation since you have so many embedded script tags. You can see that it treats your script text as if its coming in from an external file, providing script tags for you.

I prefer to do this:

sub MyJS {
    qq |
       insert your JS here, with sc! ript tags.
    |;
}
print $q -> header() . $q -> start_html(-title => $title, -style => { code => &css}) .          MyJS() . 

while its true that your JS will now be inside body tags (instead of in head tags), things work better for your situation.

My -style tag using the "code" hash key will cause CGI.pm to comment and escape the  style text, plus add the style tags.

hth,
Mark Pryor
--


Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to