Tutorial by Jonathan Suh

Demo: jQuery AJAX Call to PHP Script with JSON Return

Playground


Favorite beverage:
Favorite restaurant:
Gender:
JSON:

Usage

If you are running this locally, files must be running via a virtual server on your machine with PHP installed.

  • Don't forget to include the jQuery library.
  • Full JSON return is accessed via data["json"]
  • Individual JSON data can be accessed via data["name"]
  • File should be placed according to what you set the AJAX URL in the jQuery script.

Using this menu on your website