DEV Community

Discussion on: Huge problem: code does not go further than await

r0bnet profile image
rob • Edited on

You have to await Q and then execute .json() on the result. fetch() returns a promise that can be awaited.

Would probably go for something like:

 let Q = await fetch('/ajax/get', {
  method: 'POST',
  body: FD
let data = await Q.json();

Read 4th parahraph under Concepts and usage:

dieldore profile image
Dieldore Author

Thank you, just noticed. In a hurry forgot to specify await