in reply to Browser compatibility!
Short answer: as much as you print out.
Perl is a server-side language, JavaScript is a client-side language. That being said, a client doesn't care what generates the content it requests, be it Perl or PHP - just as long as it starts with a valid HEADER.
I have written CGI scripts that were implemented in Perl that created JavaScript code embedded in HTML 'code.' If the JavaScript code is non-compatible across different browsers, it's not Perl's fault - it's MicroSoft's^Wthe browser's fault.
Just remember that the problem is on the client's side. Luckily though, a Perl CGI script can detect what browser was used when it gets a request by checking the value of $ENV{'HTTP_USER_AGENT'}. Here's a real world example:
my $browser = $ENV{'HTTP_USER_AGENT'}; my $explode = ($browser =~ /MSIE (\d+(?:\.\d+)?)/ && $1 >= 5); if ($explode) { # print out IE5 compliant javascript code print " document.form.select.options.remove(0); "; } else { # print out standard (i wish) javascript code print " document.form.select.options[0] = null; "; }
Jeff
happy happy joy joy happy happy joy joy
|
|---|