NYCPHP Meetup

NYPHP.org

[nycphp-talk] Wordpress & Ajax

Kristina Anderson ka at kacomputerconsulting.com
Fri Jul 8 17:40:11 EDT 2011


YVW Robert.  Be aware of "gotchas" such as that JSON is the default 
$data type and its syntax is very unforgiving.   What gets returned as 
the $msg is whatever text is generated by your PHP file.  So if you do 
an AJAX POST to a PHP script that prints out "This AJAX stuff really is 
easy" that text will get passed right back into your success method and 
you can dump it into a div or whatever you need to do.

On 7/8/2011 5:19 PM, Robert Kim App and Facebook Marketing wrote:
> HAH! This is exactly what I'm dealing with right now. Thanks Kristina!!
>
> On Fri, Jul 8, 2011 at 2:16 PM, Kristina Anderson
> <ka at kacomputerconsulting.com>  wrote:
>> Margaret,
>>
>> Your best bet for jQuery AJAX is to use the $.ajax function to route your
>> asynchronous communications.  All you need to do is include the main jQuery
>> file and then define your $.ajax function(s) wherever appropriate.  The
>> function has inbuilt success&  error methods which capture your returned
>> stuff from PHP and allow you to pass it through into the DOM.
>>
>> See here for comprehensive documentation:
>> http://api.jquery.com/jQuery.ajax/
>>
>> Kristina
>>
>> On 7/8/2011 1:41 PM, Margaret Waldman wrote:
>>> This is what I found:
>>> ./wp-includes/js/jquery/jquery.query.js
>>> ./wp-includes/js/jquery/jquery.form.js
>>> ./wp-includes/js/jquery/jquery.color.dev.js
>>> ./wp-includes/js/jquery/jquery.table-hotkeys.js
>>> ./wp-includes/js/jquery/jquery.serialize-object.js
>>> ./wp-includes/js/jquery/jquery.hotkeys.dev.js
>>> ./wp-includes/js/jquery/jquery.color.js
>>> ./wp-includes/js/jquery/jquery.table-hotkeys.dev.js
>>> ./wp-includes/js/jquery/jquery.form.dev.js
>>> ./wp-includes/js/jquery/jquery.schedule.js
>>> ./wp-includes/js/jquery/jquery.hotkeys.js
>>> ./wp-includes/js/jquery/jquery.js
>>> ./wp-includes/js/imgareaselect/jquery.imgareaselect.dev.js
>>> ./wp-includes/js/imgareaselect/jquery.imgareaselect.js
>>> ./wp-includes/js/jcrop/jquery.Jcrop.js
>>> ./wp-includes/js/jcrop/jquery.Jcrop.dev.js
>>>
>>> A grep on ajax on the jquery.js file spewed out lotsa code.  Looks like
>>> I'll be good.
>>>
>>> -----Original Message----- From: Darryle Steplight
>>> Sent: Friday, July 08, 2011 11:41 AM
>>> To: NYPHP Talk
>>> Subject: Re: [nycphp-talk] Wordpress&  Ajax
>>>
>>> Hey Margaret,
>>>       1. Just because a file uses jquery that doesn't mean it has
>>> ajax functionality. You still have to make the ajax call on your own
>>> if the showcase.js file isn't doing so.
>>>       2. I'm not worried about  the details of your project. I was
>>> going to help you and provide a solution on how I used my own jquery
>>> ajax solution for my own wordpress project, but like you so
>>> professionally said it "that's your problem".  Good luck.
>>>
>>> On Fri, Jul 8, 2011 at 11:35 AM, Margaret Waldman<mmwaldman at nyc.rr.com>
>>> wrote:
>>>> Darryle,
>>>>
>>>> I see the file showcase.js in the themes/js directory uses jquery, which
>
>





More information about the talk mailing list