Improved the ajax controller.

This commit is contained in:
2021-08-31 16:00:12 +02:00
parent 1651d4358c
commit 5651d3dca8
15 changed files with 307 additions and 153 deletions

View File

@@ -27,8 +27,8 @@ class ###Component###ControllerAjax extends JControllerLegacy
parent::__construct($config);
// make sure all json stuff are set
JFactory::getDocument()->setMimeEncoding( 'application/json' );
JResponse::setHeader('Content-Disposition','attachment;filename="getajax.json"');
JResponse::setHeader("Access-Control-Allow-Origin", "*");
JFactory::getApplication()->setHeader('Content-Disposition','attachment;filename="getajax.json"');
JFactory::getApplication()->setHeader("Access-Control-Allow-Origin", "*");
// load the tasks
$this->registerTask('fieldRequired', 'ajax');
}