You are here: Re: Java Script and PHP « PHP Programming Language « IT news, forums, messages
Re: Java Script and PHP

Posted by macca on 12/23/07 19:27

On Dec 23, 1:43 pm, Jonas Werres <jo...@example.org> wrote:
> > Or save a file named myscript.js.php. In the file you can use both
> > javascript and php. For example, you can write:
>
> > alert( <?php 12 + 15 ?> )
>
> > and then include it in your html with:
>
> > <script type="text/javascript" language="JavaScript"
> > src="myscript.js.php"></script>


Its still the same thing. The PHP is interpreted on the server before
the javascript on the client,

so, what is sent to the client is actually

alert(27)

it's the same as having a file called script.php and writing

<script language="javascript" type="text/javascript">
alert(<?php echo 12 + 15; ?>)
</script>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация