[TYPO3-english] Problem integrating extbase with AJAX
Antonio H
espelunca at gmail.com
Mon May 12 15:19:58 CEST 2014
Hi everybody, i'm a newcomer to extbase/fluid development...
I'm starting with a new project. I'm trying to get ajax (jquery) working over extbase. I've had a look at several links where i've learned that i can try the eid mechanism... The problem is that i can't make this work!
I've copied an AJAX dispatcher into my classes folder (this is my firt post and i can't use links!!!)
h t t p : // stackoverflow.com/questions/21139769/typo3-extbase-ajax-without-page-typenum
I've changed the name and vendor of my extension as mentioned above and added a new action method in my controller... This is a very small and simple method where i only return a line of code:
json_encode("Hello");
------------------
In the dispatcher, i've changed the extensión's and vendor's name:
$ajax['vendor'] = 'MYVENDOR';
$ajax['extensionName'] = 'EventCalendar';
-------------------
The jquery that trigger the action is this:
$('.evento').click(function(e) {
$.ajax({
async: 'true',
url: 'index.php',
type: 'POST',
data: {
eID: "ajaxDispatcher",
request: {
pluginName: 'main',
controller: 'Event',
action: 'pruebaAjax',
arguments: {
'numero':5
}
}
},
dataType: "json",
success: function(result) {
console.log(result);
},
error: function(error) {
console.log(error);
}
});
---------------------------
And i've registrered the dispatcher in ext_localconf.php:
$TYPO3_CONF_VARS['FE']['eID_include']['ajaxDispatcher'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('myevents').'Classes/ajax.php';
where myevents is the extensión key...
---------------------------
But after trying to google and to find some information, i always get in the javascript console:
Failed to load resource: the server responded with a status of 500 ( internal server error).
Thank you very much in advance.
More information about the TYPO3-english
mailing list