Answer the question
In order to leave comments, you need to log in
The console displays information in json format, how to get text from it and display it on the site?
The console displays information in json format, how to get a picture from it and display it on the site?
What is displayed in the console (for example):
{"id":20,"name":"Nikita"}
All this should be transferred to the page in the function. For example, what would be like this:
Name: Nikita
Number: 20.
Answer the question
In order to leave comments, you need to log in
As an example:
$(document).ready( function() {
$.getJSON("/user", function(arr){
$.each(arr.data, function(){
$("#dt_basic").append("<tr><td>" + this['username'] + "</td><td>" + this['phoneNumber'] + "</td><td>" + this['company'] + "</td><td>" + this['city'] + "</td><td>" + this['activated'] + "</td>");
});
});
});
Using JSON.parse(), you can get a JS object from JSON, and then work with it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question