Reply to Re: IE Problem : Dynamic Javascript in PHP constructor

Your name:

Reply:


Posted by R. Rajesh Jeba Anbiah on 09/28/67 11:49

pulkit.gaur@gmail.com wrote:
> Hi all ,
>
> I have a PHP class.
> In the constructor method i use the following code :
>
> constructor func .......
> {
> echo "<script type=\"text/javascript\">";
> echo "alert('hi');
> echo "</script>";
> }

FWIW, many people don't know that they can embed HTML inside PHP;
if embedded, it's easier to maintain/debug and faster to execute.
Example:
function foo()
{
?>
<script>
alert("foo");
</script>
<?php
}

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

[Back to original 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

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