从xml接收单个数据

I have brought some data from the server using ajax. Now I want to, not bring all the data, only the name is inter. How can I do this? that my code

const url = 'https://jsonplaceholder.typicode.com/users'

const xhr = new XMLHttpRequest()

xhr.onreadystatechange = () => {
    console.log(xhr.response);
}
xhr.open('GET', url)
xhr.send()

You could loop through the xhr response and get the name of the users.

   xhr.onreadystatechange = () => {
     if(xhr.response) {
       let userResponse = JSON.parse(xhr.response);
       for (index in userResponse) {
           console.log(userResponse[index].name);
       }
     }
   }

You can even save it in a temporary variable and make further manipulations.

But if you meant bringing just the name from the server, it is not possible unless the server exposes an API to do so.

If you have access to the server you could create an API to do this. But, if your server had used graphQL, it is possible to make queries while making API requests like you asked for.