Re: Sending html via ajax -vs- building html in js (was: jQuery Ajax request to update a PHP variable)

From: Jonathan Rochkind <rochkind_at_nyob>
Date: Thu, 8 Dec 2011 13:37:54 -0500
To: CODE4LIB_at_LISTSERV.ND.EDU
> On Thu, Dec 8, 2011 at 9:11 AM, Godmar Back<godmar_at_gmail.com>  wrote:
>
>> If we tell newbies (no offense meant by that term) that AJAX means
>> "send a request and then insert a chunk of HTML in your DOM," we're
>> short-changing their view of the type of Rich Internet Application
>> (RIA) AJAX today is equated with.
>>
>> sure, fair point -- I just don't think there is anything wrong with
>

I would not want to tell newbies that. But if we tell newbies that 
javascript communication with the server should _always_ mean sending 
JSON, and that sending HTML is "unfashionable" and they should never do 
it, I also think we're short-changing their view, and giving them cargo 
cult "trend-following" approaches. I think there are plenty of scenarios 
where either approach is justified and appropriate.  It depends on the 
context, it depends on the rest of your stack, it depends on what's 
going on. There is no substitute for actual thought and analysis and 
decision.
Received on Thu Dec 08 2011 - 13:39:10 EST