Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

167
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!