function webfm_json in Web File Manager 5
Same name and namespace in other branches
- 5.2 webfm.module \webfm_json()
Return 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.
Parameters
$var: (optional) If set, the variable will be converted to JSON and output.
1 call to webfm_json()
- webfm_ajax in ./
webfm.module - Ajax post requests
File
- ./
webfm.module, line 1793
Code
function webfm_json($var = NULL) {
// We are returning JavaScript, so tell the browser.
drupal_set_header('Content-Type: text/javascript; charset=utf-8');
if (isset($var)) {
echo drupal_to_js($var);
}
}