Answer the question
In order to leave comments, you need to log in
How to get JSON data from a string?
In the controller, I return the response in the form of JSON.
If you look at the response using AJAX, then the response returns an object. Everything is great.
$.ajax({
url: // ссылка на контроллер
type: "GET",
success: function(data) {
// Здесь data - это объект. Jquery сам спарсил мне Json
}
});
'onComplete' => new JsExpression("
function(fileName, responseJSON) {
alert(responseJSON); // Здесь не объект, а строка. Причем строка такая <pre>{JSON:JSON}</pre>
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question