NYCPHP Meetup

NYPHP.org

[nycphp-talk] talk Digest, Vol 42, Issue 15

Kenneth Downs ken at secdat.com
Thu Nov 9 18:28:19 EST 2006


Nate Abele wrote:
> Ken, any reason you wouldn't just generate JavaScript to be eval'd on  
> the client side?
>   

Only inertia :)

The code we have works, so I've kind of gone on to other things.

> I would think that would actually be more efficient, despite the use  
> of eval().  It also saves you from having to re-implement more  
> JavaScript language features, should you choose to expand your  
> dynamic capabilities.  Also, (and the likelihood of this may be a  
> little far-fetched), it insulates you against having your client side  
> code misinterpret control character sequences embedded in the text.
>
> Thanks for indulging my curiosities.
>
> -Nate
>
>   
>> Date: Thu, 09 Nov 2006 15:02:57 -0500
>> From: Kenneth Downs <ken at secdat.com>
>> Subject: Re: [nycphp-talk] So who's using Ajax anway?
>> To: NYPHP Talk <talk at lists.nyphp.org>
>> Message-ID: <45538971.6000704 at secdat.com>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> David Mintz wrote:
>>     
>>> For you guys, does the X in AJAX really stand for XML? Or are you  
>>> sending
>>> back finished HTML?
>>>
>>>       
>> Finished HTML.
>>
>> On the PHP side we send back a big string, composed of object IDs and
>> innerHTML values.  Delimiters are pipe and a pipe-star-pipe, like the
>> following:
>>
>> object_1|<span class="notice">Everything worked great!</span>
>> |-|
>> object_2|<table><tr>.....
>> |-|
>> object_3|<select><option>....
>>
>> The browser side cuts it up and assigns the innerHTML.
>>
>> We can also send alerts back for debugging, like this:
>>
>> echo|This text will appear in an alert
>>
>> and finally if there is no pipe symbol in the return, the js assumes
>> something is very wrong and displays the HTML in an alert.  It does  
>> the
>> same thing if the named object does not exist.
>>     
>
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20061109/2ea27616/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ken.vcf
Type: text/x-vcard
Size: 261 bytes
Desc: not available
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20061109/2ea27616/attachment.vcf>


More information about the talk mailing list