-->

AJAX calls to TYPO3 Extension not working

2019-07-22 00:52发布

问题:

I'm trying to make an AJAX call in my application to a certain custom extension. The request seems to going, but somehow it seems like the application is not recognizing the Extension or something. I use TYPO3 V6.

The request params caught from my browser are :

id  82
no_cache    1
tx_mediaplugin_mediaplugi...    update
tx_mediaplugin_mediaplugi...    MediaPlugin
type    99

my updateAction is :

public function updateAction(){
    die('Ajaxed!');
}

I added the following script in my Extension View and I use it my AJAX function

<script>
    var updateLink =
            '<f:uri.action action="update" controller="MediaPlugin" pageType="99" noCacheHash="1" noCache="1"/>';
</script>

I added the following TS to enable ajax:

ajaxPage = PAGE
ajaxPage {
    typeNum = 99
    config {
        disableAllHeaderCode = 1
        additionalHeaders = Content-type:application/json
        xhtml_cleaning = 0
        admPanel = 0
    }
    10 < tt_content.list.20,mediaplugin_mediaplugin
}

But it does not reach to the controller. If I change the controller name to some random text MediaRadomPlugin , the request still goes but does not show any error.

id  82
no_cache    1
tx_mediaplugin_mediaplugi...    updaterandom
tx_mediaplugin_mediaplugi...    MediaRandomPlugin
type    99

Normally, it should some error saying No such controller. But it does not show any error.

Where am I going wrong here ?

回答1:

tt_content.list.20,mediaplugin_mediaplugin <--- use a dot

tt_content.list.20.mediaplugin_mediaplugin