# Inline JavaScript Fehler: document.asyncReady is not a function

**URL:** <https://forum.shopware.com/t/inline-javascript-fehler-document-asyncready-is-not-a-function/54120>\
**Category:** Themes & Design\
**Created:** [17. Juli 2018 um 10:05 UTC](https://forum.shopware.com/t/inline-javascript-fehler-document-asyncready-is-not-a-function/54120 "2018-07-17T10:05:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kommad](https://avatars.discourse-cdn.com/v4/letter/k/96bed5/32.png) [@kommad](https://forum.shopware.com/u/kommad)\
**Post date:** [17. Juli 2018 um 10:05 UTC](https://forum.shopware.com/t/inline-javascript-fehler-document-asyncready-is-not-a-function/54120/1 "2018-07-17T10:05:15Z")

</div>

Hallo, ich müsste ein JS inline einbinden.

So wie hier beschrieben: [Shopware 5 upgrade guide](https://developers.shopware.com/developers-guide/shopware-5-upgrade-guide-for-developers/#asynchronous-javascript)

**Beispiel:**

```
    document.asyncReady(function() {
        alert(1);  
    });

```

Wenn wir das z.B. in die detail/index.tpl einbinden kommt ein Fehler:&nbsp;&nbsp; **Uncaught TypeError: document.asyncReady is not a function**  
Ich müsste inline ein JS Script einbinden.&nbsp;Im Theme ist konfiguriert das JS asynchron zu laden.

Funktioniert weder mit einem eigenen Theme noch mit dem Responsive/Bare

Kann das jemand bestätigen und weiß ggf. wie man das Problem behebt?

Viele Grüße Oliver

---

<div class="post-metadata">

**Author:** ![abinjohnedamana](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/abinjohnedamana/32/17378_2.png) [@abinjohnedamana](https://forum.shopware.com/u/abinjohnedamana)\
**Post date:** [20. Juli 2020 um 05:15 UTC](https://forum.shopware.com/t/inline-javascript-fehler-document-asyncready-is-not-a-function/54120/2 "2020-07-20T05:15:12Z")

</div>

```
{* Extend the base template to get the header, navbar etc *} 
{extends file = "parent: frontend / index / index.tpl"}

{block name = "frontend_index_header_javascript_jquery"} 
    {$ smarty.block.parent} 
     
        {literal} 
            function appCustomerLogin (email, password) 
            { 
                var siteUrl = '{{$ siteUrl}}'; 
                alert (siteUrl); 
                $ .ajax ({ 
                    type: 'post', 
                    url: siteUrl + '/ NFXCustomer / login', 
                    data: {'email': email, 'password': password}, 
                    beforeSend: function () { 
                    }, 
                    success: function (result ) { 
                        if (result.
                        { 
                            window.location.href = siteUrl; 
                        } 
                    }, 
                }); 
            }

            document.asyncReady (function () { 
                appCustomerLogin ('abin @ localhost', 'dem'); 
            }); 
        {/ literal} 
     
{/ block}

```

include javacript in {block name = “frontend\_index\_header\_javascript\_jquery”} block
