Readdy Write  
0,00 €
Your View Money
Views: Count
Self 20% 0
Your Content 60% 0

Users by Links 0
u1*(Content+Views) 10% 0
Follow-Follower 0
s2*(Income) 5% 0

Count
Followers 0
Login Register as User

Javascript Error: Uncaught (in promise) ReferenceError: response is not defined

23.03.2023 (πŸ‘2668)


 

Error Message

Uncaught (in promise) ReferenceError: response is not defined

 

 

Wrong code:

fetch("http://localhost:3000/articles/" + this.idarticle)

        .then(

          response.json()         

        )

 

Solution: Create an Arrow-Function

      fetch("http://localhost:3000/articles/" + this.idarticle)

        .then(response => response.json()          

        )

Oder (param) => expression

      fetch("http://localhost:3000/articles/" + this.idarticle)

        .then((response) => response.json()          

        )

 

 

Ein Bild, das Text enthΓ€lt.

Automatisch generierte Beschreibung