Better? Renenber that nothing will happen until the script is loaded,
and another connection to the server will have to be set up to load it,
or check it's not been updated at least, so you'll loose time.
lee
"Kirkup, Steve" wrote:
>
> A better way to deal with Javascript is to include a link to a file
> with your
> code in a seperate file. You include something like this in the header
> section of
> the HTML file.
>
> <script language="Javascript1.2" src="/default.js" type="text/javascript">
>
> Cuts down the amount of time that your script has to spend issue print
> statements and
> seperates out the Javascript from the rest of your code.
>
> Steve K
>
> > -----Original Message-----
> > From: Lee Goddard [SMTP:[EMAIL PROTECTED]]
> > Sent: Tuesday, February 20, 2001 11:19 AM
> > To: Herbold, John W.
> > Cc: '[EMAIL PROTECTED]'
> > Subject: Re: Nesting javascript in CGI
> >
> > Sorry about the typo - the tag (EOT or EOF) should be the
> > same at both ends, of course. And yes, the final tag
> > should be on a line by itself with NOTHING else, not even
> > a semi-colon!
> >
> > hth
> > Lee
> >
> > "Herbold, John W." wrote:
> > >
> > > Lee,
> > > I have not tried the "'s around EOT but two questions about
> > > it, Would you not need the EOT at the end instead of the EOF,
> > > and I get errors if I put the ; after the EOF and not on another
> > > line ? ?
> > >
> > > John
> > >
> > > -----Original Message-----
> > > From: Lee Goddard [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, February 20, 2001 9:28 AM
> > > To: Herbold, John W.
> > > Cc: '[EMAIL PROTECTED]'
> > > Subject: Re: Nesting javascript in CGI
> > >
> > > And if there are variables interspersed in the
> > > output delimited by EOT, double-quote the marker EOT
> > > thus:
> > >
> > > print <<"EOT";
> > > <SCRIPT language=JavaScript>
> > > function x(){
> > > document.write('$msg');// quotes are for JS, not perl
> > > }
> > > </SCRIPT>
> > > EOF;
> > >
> > > hth
> > > lee
> > >
> > > "Herbold, John W." wrote:
> > > >
> > > > I have done some of this, due to the fact that Javascript is ran
> > > > on the browser you need to send it there just as you would regular
> > > > HTML output, with a print
> > > >
> > > > print "<SCRIPT language=JavaScript>";
> > > >
> > > > or if there is a lot..
> > > >
> > > > print <<EOT;
> > > > <SCRIPT language=JavaScript>
> > > > function one();
> > > > {
> > > >
> > > > }
> > > >
> > > > Function fx();
> > > > {
> > > >
> > > > }
> > > >
> > > > EOT
> > > > ;
> > > >
> > > > John
> > > >
> > > > -----Original Message-----
> > > > From: Sharon Tiroff [mailto:[EMAIL PROTECTED]]
> > > > Sent: Tuesday, February 20, 2001 8:06 AM
> > > > To: '[EMAIL PROTECTED]'
> > > > Subject: Nesting javascript in CGI
> > > >
> > > > Hi, I am new to CGI programming so this question may be out there -
> > > > Is it possible to write JavaScript directly in your CGI?
> > > >
> > > > If so, how do you go about identifying that you are using JavaScript
> > > > (<SCRIPT language=JavaScript>)?
> > > >
> > > > Thanks,
> > > >
> > > > Sheri
> > > >
> > > > _______________________________________________
> > > > ActivePerl mailing list
> > > > [EMAIL PROTECTED]
> > > > http://listserv.ActiveState.com/mailman/listinfo/activeperl
> > > > _______________________________________________
> > > > ActivePerl mailing list
> > > > [EMAIL PROTECTED]
> > > > http://listserv.ActiveState.com/mailman/listinfo/activeperl
> > >
> > > --
> > >
> > > Lee Goddard <[EMAIL PROTECTED]>
> > > -------------------------------------
> > > Perl : XML : XSLT : XHTML / JS : Java
> > >
> > > "Post-modernism....the meta-narrative that denies meta-narrative."
> > > - Cedric Watts, Sussex 1997
> > > _______________________________________________
> > > ActivePerl mailing list
> > > [EMAIL PROTECTED]
> > > http://listserv.ActiveState.com/mailman/listinfo/activeperl
> >
> > --
> >
> > Lee Goddard <[EMAIL PROTECTED]>
> > -------------------------------------
> > Perl : XML : XSLT : XHTML / JS : Java
> >
> > "Post-modernism....the meta-narrative that denies meta-narrative."
> > - Cedric Watts, Sussex 1997
> > _______________________________________________
> > ActivePerl mailing list
> > [EMAIL PROTECTED]
> > http://listserv.ActiveState.com/mailman/listinfo/activeperl
> _______________________________________________
> ActivePerl mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/activeperl
--
Lee Goddard <[EMAIL PROTECTED]>
-------------------------------------
Perl : XML : XSLT : XHTML / JS : Java
"Post-modernism....the meta-narrative that denies meta-narrative."
- Cedric Watts, Sussex 1997
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl