# Ajax Call in Backend Controller ausführen

**URL:** <https://forum.shopware.com/t/ajax-call-in-backend-controller-ausfuehren/86091>\
**Category:** Shopware 5\
**Created:** [16. März 2021 um 12:39 UTC](https://forum.shopware.com/t/ajax-call-in-backend-controller-ausfuehren/86091 "2021-03-16T12:39:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mewcrazy](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/mewcrazy/32/10044_2.png) [@mewcrazy](https://forum.shopware.com/u/mewcrazy)\
**Post date:** [16. März 2021 um 12:39 UTC](https://forum.shopware.com/t/ajax-call-in-backend-controller-ausfuehren/86091/1 "2021-03-16T12:39:43Z")

</div>

Ich versuche in einem eigenem Backend Controller einen Ajax Call auszuführen.

```
                $.ajax({
                    dataType: "json",
                    url: "{url controller=ExampleModulePlainHtml action=myaction}",
                    data: { id: 4 },
                    success: function (resp) {
                        console.info(resp);
                    }
                });

```

Mit o.g. genannter Smarty-Variable erhalte ich auch die richtige URL: https://\*\*/staging/backend/ExampleModulePlainHtml/getthefuckoff?id=4 - allerdings erhalte ich einen 404.

In meinem Controller, der aktuell keinerlei Subscriber hat, habe ich folgende Funktion erstellt:

```
class Shopware_Controllers_Backend_ExampleModulePlainHtml extends Shopware_Controllers_Backend_Application implements CSRFWhitelistAware {
protected $model = Product::class;
protected $alias = 'product';

public function getthefuckoff() {
    $this->container->get('front')->Plugins()->ViewRenderer()->setNoRender();

    return "asdasd";
}

```

}

Was muss ich noch machen damit die action erreichbar ist bzw. angesprochen wird?

LG,  
Dennis
