[cgiapp] Ajax app using CAP -- return JSON or HTML?

Bruce McKenzie bruce at 2MinuteExplainer.com
Tue May 27 08:02:22 EDT 2008



Bruce McKenzie wrote in an email message dated 5/26/2008 6:48 PM:
> It is easy. Just turn the html into a jQuery object (a pseudo-Array). 
> The ajax call should include options like these:
> 
> dataType: "html",
> success: function(html){
> // return from ajax is html because you specified that dataType
>    var $myDivs = $(html);
>    $('#someDiv').html( $myDivs.eq(0) );
>    $('#anotherDiv').replace( $myDivs.eq(1) );
>   //etc
> }
> 
> HTH
> 
> Bruce


er, that won't help because it should be
   $myDivs = $(html).find('div');



-- 
Bruce McKenzie
Business Information Graphics

212-477-4288
http://www.2MinuteExplainer.com


More information about the cgiapp mailing list