in reply to Javascript in CGI header

header is for HTTP headers, not HTML ... you can find the documentation at CGI and extra examples in the examples directory.