Index: typo3/classes/class.typo3ajax.php =================================================================== --- typo3/classes/class.typo3ajax.php (revision 5944) +++ typo3/classes/class.typo3ajax.php (working copy) @@ -142,7 +142,7 @@ * @return void */ public function setContentFormat($format) { - if (t3lib_div::inArray(array('plain', 'xml', 'json', 'jsonhead', 'jsonbody'), $format)) { + if (t3lib_div::inArray(array('plain', 'xml', 'json', 'jsonhead', 'jsonbody', 'javascript'), $format)) { $this->contentFormat = $format; } } @@ -186,6 +186,9 @@ case 'json': $this->renderAsJSON(); break; + case 'javascript': + $this->renderAsJavascript(); + break; case 'xml': $this->renderAsXML(); break; @@ -259,6 +262,25 @@ echo $content; } } + + /** + * Renders the AJAX call as inline JSON inside a script tag. This is useful + * when an iframe is used as the AJAX transport. + * + * @return void + */ + protected function renderAsJavascript() { + $content = ''; + + header('Content-type: text/html; charset=' . $this->charset); + echo $content; + } }