Answer the question
In order to leave comments, you need to log in
How to store the data received in the response by variables?
It is necessary to get data from json (object) using an Ajax request on jquery and store the values of some fields from it by variables. These variables should be used later. Json is located at . This is a copy of it with some fields marked for preservation. If there is a solution, then by analogy I will save the rest of the data.
{
"state": "ok",
"data": {
"product_id": "806",
"first_period_everyday_percent": "0,01",
"first_period_year_percent": "3,6",
"second_period_everyday_percent": "1,9",
"second_period_year_percent": "684",
"first_period_day_count": "21",
"min_sum": "500", // в переменную minSum
"max_sum": "5000", // в переменную maxSum
"default_sum": "5000",
"sum_step": "100",
"min_term": "5", // в переменную maxTerm
"max_term": "21", // в переменную minTerm
"default_term": "21",
"term_step": 1,
"repeat_question": false
}
}
Answer the question
In order to leave comments, you need to log in
Open your browser console right now and type:
response = await $.ajax('https://kachay.com.ua/calculation_info.php');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question