Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

168
Vistas
How do you insert username into a text?

I'm getting a value which is the username of an account and I want to place it in a text.

For example, the HTML code will look like this. Ignore the review_array[i].date_posted cause I already completed that part.

<small>by " + username + " @ " + review_array[i].date_posted + "</small>

I have a jquery function where I will be getting the username but I am clueless on how to place the username in. How do I somehow insert the username in?

here is the code for my function of getting the username

$(document).ready(function() {

    var getProfile2 = new XMLHttpRequest();

    getProfile2.open("POST", "http://127.0.0.1:8080/member", true);
    getProfile2.setRequestHeader("Content-Type", "application/json");
    getProfile2.onload = function() {
        var profile2 = JSON.parse(getProfile2.responseText);
        console.log(getProfile2.responseText);
        username = profile2[0].username;

    }
    var payload = { token: token };
    getProfile2.send(JSON.stringify(payload));
})

node.js to make date posted to get the timing now

var new = new Date();

function for getting date posted automatically

function fetchReviews() {
    var request = new XMLHttpRequest();

    request.open('GET', review_url, true);

    //This command starts the calling of the reviews api
    request.onload = function () {
        //get all the reviews records into our reviews array
        review_array = JSON.parse(request.responseText);
        console.log(review_array);
    };

    request.send();
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda