waris has asked for the wisdom of the Perl Monks concerning the following question:
From research, I'm assuming I need to use "Content-type: application/x-javascript\n\n" but haven't been able to find any details. Does it go in the head section of the html immediately in front of all the javascript functions? Does it need to be repeated for each function? And/Or does it need to be embedded in the body wherever a javascript function is called? Or am I totally incorrect about what is needed? My experiments thus far have all failed and I suspect I'm missing something simple.
A sample, here is the onSubmit statement:and here are the functions in the head of the htmlonSubmit="return (CompareD(this) && valisort(this));"
If someone could show me where/how to use the content type statement back and forth between javascript and html in this example, I would be eternally grateful! (I realize that some of the functions could be totally re-created in Perl but clientside onBlur and onFocus for instance would be difficult - at least for me!)<SCRIPT language="JavaScript"> function CompareD(thd){ //function details } </script> <SCRIPT language="JavaScript"> function valisort(pmp){ //function details } </script>
edited: Tue Dec 9 20:59:15 2003 by jeffa - code tags and formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: embedding Javascript in perl generated html
by janjan (Beadle) on Dec 09, 2003 at 19:59 UTC | |
|
Re: embedding Javascript in perl generated html
by waswas-fng (Curate) on Dec 09, 2003 at 19:24 UTC | |
|
Re: embedding Javascript in perl generated html
by Theo (Priest) on Dec 10, 2003 at 15:39 UTC | |
|
Re: embedding Javascript in perl generated html
by Cody Pendant (Prior) on Dec 09, 2003 at 20:17 UTC |