<?php
/*
* displays a chunk or not wheter the modx front-end document is called via ajax or not
*
* PARAMS
*
* &chunk=`chunkname`
*/
if ( $chunk != '' ) { // how to know if ajax ?
$output = $modx->getChunk($chunk);
}
echo $output;
?>