this code I am writing after componentDidMount :
componentDidMount: function() {
var url = document.URL;
var currentId = url.substring(url.lastIndexOf('?') + 4);//getting the current ID from the url
var data = {
idtoUpdate: currentId
};
$.ajax({
type: 'POST',
url: 'test.php',
data: data,
success: function(response) {
var result = $.parseJSON(response);
$("#briefinfo").html(response);//This response will prints the JSON format data which is return by test.php
}
})
.done(function(data) {
})
.fail(function(jqXhr) {
console.log('failed to register');
});
},
Here I am getting the JSON format code When I return the response it prints so I want to print this data in a textfield