Hallo Leute
ich bekomme ein parsererror bei meine Ajax Action mit json
Mein Kontroller:
protected $supportedMediaTypes = array(‘application/json’, ‘text/html’);
/**
* @var string
*/
protected $viewFormatToObjectNameMap = array(
‘html’ => ‘TYPO3\Fluid\View\TemplateView’,
‘json’ => ‘TYPO3\Flow\Mvc\View\JsonView’
);
public function getdataAction() {
$data = array(“testKey”=>‘ss’, “testKey2”=>“testValue2”);
return json_encode($data);
}
/**
-
@return void
*/
public function indexAction() {
#$this->view->assign(‘bookings’, $this->bookingRepository->findAll());
}
Mein Routes.yaml
- name: ‘HHotels REST API Proxy’
uriPattern: ‘‘
defaults:
’@package’: ‘Booking.Widget’
’@controller’: ‘Booking’
’@format’: ‘json’
’@action’: ‘getdata’
Mein View: Index.html
Kann jemand mir helfen warum obwohl der AJAX request 200 zurück gibt ein parsererror gibt?