NYCPHP Meetup

NYPHP.org

[nycphp-talk] Javascript trigger

Peter Sawczynec ps at pswebcode.com
Tue Mar 28 10:27:04 EST 2006


/*
START:Another AJAX Moment

Of course, for most JS/DHTML menu systems one would populate JS arrays with
PHP and then drive the menus from the local array(s). 

On the other had if you are creating a volatile and extensive menu/dropdown
system such as of the style: Select Your Country>> Select Your State>>
Select Your City>> Select Your Zip>> Select Your Nearest Location -- then
using AJAX is a perfectly viable solution. Yes, AJAX will show some latency,
but it is much briefer than a whole page reload.

For further reference, the team at MSFT is building an AJAX SDK shipping
with Vista. 

Even further aside, it is only a vague impression of mine, but it appeared
to me that XML usage only really finally took off and started coming up into
common programming decision making after MSFT started integrating XML into
their product. 

So... using AJAX techniques in a project is not about a belief system, but
its about moving to provide immediacy to the end-user. 

Ultimately, the objective is that consumers spend less time at the computer
interfacing and more time benefiting from the result(s). 

Warmest regards,

Peter Sawczynec,
Technology Director
PSWebcode
_Design & Interface
_Ecommerce
_Database Management
ps at pswebcode.com
718.796.1951
www.pswebcode.com

END:Another AJAX Moment 
*/ 







-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of billy reisinger
Sent: Tuesday, March 28, 2006 8:50 AM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Javascript trigger


Not necessarily - you don't have to use Ajax in this case. As Alberto said
in the first reply to your post, you can embed a Javascript array (built by
PHP during the page request) that is embedded in the page source or is
included in a javascript file.  You can then use the values in this array to
populate your menu on the fly.  No need for asynchronous requests (Ajax).  
Not that I don't like Ajax, but it is not necessarily the ideal solution in
this case - why grab the menu data from the database every time the user
mouses over or selects a parent category?  There is certain to be noticeable
latency every once in a while; in addition, this behavior wastes bandwidth
and server processing time.  If you were running a website that got a ton of
traffic, this would be a big no-no. 
Uncle Billy


On 3/27/06, Alberto dos Santos <yournway at gmail.com> wrote:
Thank you all,
I think I have to study that "ajax thing", oh dear....

Cheers,




-- 
Alberto dos Santos
Consultor em TI
IT Consultant

http://www.yournway.com
A internet à sua maneira.
The Internet your own way. 


_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
New York PHP Conference and Expo 2006
http://www.nyphpcon.com 
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php 




More information about the talk mailing list