【问题标题】:TYPO3 Backend: AJAX with jQuery (params empty)TYPO3 后端:带有 jQ​​uery 的 AJAX(参数为空)
【发布时间】:2015-08-20 16:24:59
【问题描述】:

根据后端 API:https://docs.typo3.org/typo3cms/CoreApiReference/JavaScript/Ajax/Backend/Index.html 我可以使用每个库在 TYPO3 后端进行 AJAX 调用。

我收到成功消息,但我的 params 数组始终为空:

控制器

public function renderShowModal($params = array(), \TYPO3\CMS\Core\Http\AjaxRequestHandler &$ajaxObj = NULL){
    var_dump($params);
}

jQuery

            $.ajax({
            type: 'POST',
            url: TYPO3.settings.ajaxUrls['Controller::renderShowModal'],
            data: {
                "test": "bar"
            },
            success: function (result) {
                console.log(result);
            },
            error: function (error) {
                console.log(error);
            }
        });

我遗漏了什么或者我必须如何发送我的数据?

它甚至不是这样工作的:

{"tx_ext_bm[test]": "bar"}

提前致谢

【问题讨论】:

  • 没有人能提供一个在 TYPO3 后端使用 jQuery Ajax 的工作示例吗?

标签: extbase typo3-6.2.x


【解决方案1】:

在我质疑过的任何一个论坛中都没有答案,所以我最终使用$_POST 以传统方式访问参数。

【讨论】:

    猜你喜欢
    • 2010-10-09
    • 2012-12-06
    • 2016-03-06
    • 1970-01-01
    • 2011-11-28
    • 2018-06-01
    • 1970-01-01
    • 2011-04-15
    • 1970-01-01
    相关资源
    最近更新 更多