RE: [PHP] Re: Embedding JavaScript into a PHP generated web page
| From: | Ford, Mike [LSS] | Date: | Mon, 26 Jul 2004 09:27:03 +0000 |
| Subject: | RE: [PHP] Re: Embedding JavaScript into a PHP generated web page | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-191872@lists.php.net to get a copy of this message | ||
On 26 July 2004 01:13, Robert Frame wrote:
> OK, now I am bewildered again.
>
> Sample Code
>
> <?php
>
> echo '<script language="text/javascript">';
<script language="JavaScript">
> echo '<!-- ';
> echo 'function myWindow() { alert("javascript from php")}';
> echo '//--> </script>';
There's no need to echo your script from php -- just as with large chunks of
regular html, you can drop out of php mode and just write it as you want it:
?>
<script language="JavaScript">
<!--
function myWindow() { alert("javascript from php")}
//-->
</script>
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211