Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

169
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda