function drupal_json_output

cis7 drupal_json_output($var = NULL)
cle7 drupal_json_output($var = NULL)
elmsmedia7 drupal_json_output($var = NULL)
icor7 drupal_json_output($var = NULL)
meedjum_blog7 drupal_json_output($var = NULL)
mooc7 drupal_json_output($var = NULL)

Returns data in JSON format.

This function should be used for JavaScript callback functions returning data in JSON format. It sets the header for JavaScript output.


$var: (optional) If set, the variable will be converted to JSON and output.

49 calls to drupal_json_output()
accessibility_content_load_tests_json in sites/all/modules/ulmus/accessibility/modules/accessibility_content/
accessibility_tests_json in sites/all/modules/ulmus/accessibility/
Outputs settings and test information in JSON.
accessibility_test_page_view_json in sites/all/modules/ulmus/accessibility/accessibility.module
JSON render callback for accessibility test entities.
ckeditor_link_autocomplete in sites/all/modules/ulmus/ckeditor_link/ckeditor_link.module
context_ui_get_available_blocks in sites/all/modules/ulmus/context/context_ui/context_ui.module
Ajax callback to get the list of available blocks

... See full list

2 string references to 'drupal_json_output'
og-7.x-1.x.database.php in sites/all/modules/ulmus/og/tests/og-7.x-1.x.database.php
Filled installation of Drupal 7.0, for test purposes.
system_menu in modules/system/system.module
Implements hook_menu().


includes/, line 5041
Common functions that many Drupal modules will need to reference.


function drupal_json_output($var = NULL) {
  // We are returning JSON, so tell the browser.
  drupal_add_http_header('Content-Type', 'application/json');

  if (isset($var)) {
    echo drupal_json_encode($var);