Estoy usando la API de discord para obtener toda la información sobre los usuarios y sus gremios. Pero cuando filtro toda la información que necesito e intento mostrarla en la parte delantera de mi aplicación. Se muestra como: Objeto, objeto, estuve tratando de hacer esto durante mucho tiempo y me confunde mucho. Por favor ayuda. Gracias
Estoy usando expreso.
Código HTML:
<head> <meta charset="UTF-8"> </head> <style> #body { text-align: center; margin-top: 100px; } #h1info { color: black; font-family: Arial; } #guild { color: black; font-family: Arial; } #b1 { background-color: white; height: 80px; border: 2px solid black; border-radius: 30px; width: 70%; text-align: left; padding: 15px 15px; margin-top: 10px; } </style> <body id="body"> <img src="https://cdn.discordapp.com/avatars/<%=id%>/<%=avatar%>"> <H1 id="h1info">Username: <%=username%><br>ID: <%=id%> </H1> <br><br> <script> var guildsLength = '<%=guildsLength%>'; var guilds = '<%=guilds%>'; document.addEventListener('DOMContentLoaded', function () { for (var i = 0; i < guildsLength; i++) { var button = document.createElement('button'); button.type = 'button'; button.innerHTML = guilds; button.className = 'btn-styled'; button.id = 'b1' button.onclick = function () { // … }; document.body.appendChild(button); } }, false); </script> </body> </html> My array looks like this: [ { name: '👻 • Ghost Community', id: '920369960419721267' }, { name: 'KAROVICH', id: '951578230496850021' }, { name: 'BOTTESTER V2', id: '977826403221385277' } ]