NYCPHP Meetup

NYPHP.org

[nycphp-talk] Re: [PHP-DB] How do u preffer ur Javascript in PHP?

Phillip Powell phillip.powell at adnet-sys.com
Tue Sep 21 09:59:46 EDT 2004


Joseph Crawford wrote:

>i would prefer the php way ;)
>  
>

I prefer a good combination of both.  If you go "the php way", then you 
put more burden on the server than you probably would need to, whereas 
if you do more in Javascript in "pure form" then you take away a lot of 
the server burden to put onto the client, however, be prepared for the 
various "browser war"-related issues while doing so.

What I usually do is that I will write a PHP class like a 
JavascriptGenerator class that will dynamically build the necessary 
Javascript functions and scripts to be plugged into the resulting HTML 
to allow for the server to dynamically build what is necessary, all the 
while allowing the client to "share the load" so to speak.

Phil

>
>On Tue, 21 Sep 2004 05:36:59 +0400, M Saleh EG <m.saleh.eg at gmail.com> wrote:
>  
>
>>Is it better if u have ur javascript alone (for example a good JS
>>framework to make anykind of UI elements u need?) or would u preffer
>>having a good set of PHP classes that generates those UI elements for
>>u from PHP w/o even touching JS or even knowing it?
>>
>>to be clear,
>>Would u write this <script type="text/javascript>alert("I preffer pure
>>JS");</script>
>>or would u write JS::Alert("I preffer using PHP code");
>>
>>Which one would u prefer? or which method do u use?
>>
>>--
>>PHP Database Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>    
>>
>
>
>
>  
>


-- 
---------------------------------------------------------------------------------
Phil Powell
Multimedia Programmer
BPX Technologies, Inc.
#: (703) 709-7218 x107 
Fax: (703) 709-7219

	




More information about the talk mailing list