Doing AJAX in WordPress

Preview of presentation:

WordPress makes AJAX easy and all too often developers write their own code for handling AJAX. The purpose of this presentation is to walk developers through the process of implementing basic AJAX functionality in themes and plugins. Topics covered will include best practices, client-side AJAX requests via jQuery, server-side processing of requests with WordPress action hooks, proper inclusion of scripts, localizing data and implementing nonces. Sample code will be made available for download.

Download Sample Code

Download Slides

Additional Resources:

Presented at:

Comments

  1. i guess in some cases you need to parse the response with jQuery.parseJSON(response) to access it with response.status and so on..

    • Correct. However, when you define JSON as the expected data type in the jQuery AJAX handler, that step isn’t necessary.

Speak Your Mind

*