I have a perl script which works fine. It does some browser detection, then prints some things, followed by a javascript statement which inserts two line breaks that I only want some browsers to see (thus the javascript inside perl).
This works :
print "Content-type: text/html\n\n";
print "<script language=\"javascript\">\n";
print 'document.write(\'<br><br>\')';
print '</script>';
This doesn't work, although I can get it to print the code, which I can see with view source, but without doing the line breaks:
print "Content-type: text/html\n\n";
print "<script language=\"javascript\">\n";
print "<\!-- ";
print 'document.write(\'<br><br>\')';
print "// -->";
print "</script>";
In other words, I'm trying to include the usual code to hide the javascript from older browsers as opposed to the first example I shown above. What you see here is only my latest attempt. I've tried all sorts of variations - single quotes, double quotes, escaping different characters, etc. Can any of you Perl gurus who also know some javascript shed some light on this?
TIA,
Paul
This works :
print "Content-type: text/html\n\n";
print "<script language=\"javascript\">\n";
print 'document.write(\'<br><br>\')';
print '</script>';
This doesn't work, although I can get it to print the code, which I can see with view source, but without doing the line breaks:
print "Content-type: text/html\n\n";
print "<script language=\"javascript\">\n";
print "<\!-- ";
print 'document.write(\'<br><br>\')';
print "// -->";
print "</script>";
In other words, I'm trying to include the usual code to hide the javascript from older browsers as opposed to the first example I shown above. What you see here is only my latest attempt. I've tried all sorts of variations - single quotes, double quotes, escaping different characters, etc. Can any of you Perl gurus who also know some javascript shed some light on this?
TIA,
Paul