[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Basic consumption of rest response by simple javascript

Status
Not open for further replies.
O

OctavioOlguin

Guest
I mapped this way: and changed source code of js script to: // Begin accessing JSON data here var data = JSON.parse(this.response).response; if (request.status >= 200 && request.status { const card = document.createElement('div'); card.setAttribute('class', 'card'); const h1 = document.createElement('h1'); h1.textContent = movie.Articulo; const p = document.createElement('p'); movie.Nombre = movie.Nombre.substring(0, 300); p.textContent = `${movie.Nombre}...`; container.appendChild(card); card.appendChild(h1); card.appendChild(p); }); } else { const errorMessage = document.createElement('marquee'); errorMessage.textContent = `Gah, it's not working!`; app.appendChild(errorMessage); } But still got this on console Uncaught TypeError: data.forEach is not a function at XMLHttpRequest.request.onload (transp1.js:21) request.onload @ transp1.js:21 load (async) (anonymous) @ transp1.js:16 TIA

Continue reading...
 
Status
Not open for further replies.
Top