I have a little CGI app I'm working on and getting stumped with a couple JavaScript problems. The first one is why I can't reference an external file using -script, but using the same code within the CGI works fine. Here's what I have now that opens a new browser window when the submit button is pressed:
...
my $JSCRIPT = <<EOF
function OpenWin() {
var myWindow;
var width = parseInt(screen.availWidth/3*2);
var height = parseInt(screen.availHeight/3*2);
var left = parseInt((screen.availWidth/2) - (width/2));
var top = parseInt((screen.availHeight/2) - (height/2));
var windowFeatures = "width=" + width + ",height=" + height +
",status,resizable,left=" + left + ",top=" + top +
",screenX=" + left + ",screenY=" + top;
myWindow = window.open("", "E-TimOutput", windowFeatures);
}
EOF
; print
$q->header(),
$q->start_html(
-title=>'E-Tim Navigator',
-author=>'Mike Schienle, [EMAIL PROTECTED]',
-style=>{
'src'=>'/styles/delta.css'
},
-script=>$JSCRIPT
# -script=>{
# -language=>'JAVASCRIPT',
# -src=>'/delta/js/openWin.js'
# }
),
$q->start_form(
-name=>'GUI',
-onSubmit=>"return OpenWin()"
),
...Can someone point out what I'm missing in the -script section that's commented out that would make it not work correctly? The source of the file that's referenced is identical to what's in the JSCRIPT variable.
Mike Schienle
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
