I tried to get a new value by transferring one of the json.dumps values to form data by using ajax once more in ajax (inside the success) such as json.dumps, but it says I can't find it. When I took an alt using JSON.parse, it was output only as an object, and when ajax turned, the definition popped up the same way
If the value of the first success is passed to the unique_key value string instead of the transformed value of the dictionary type json.dumps, the code below will function normally.
Below is the example code. When I took a photo of the alot in the first success,
{"msg": "\uac80\uc0c9\uc911\uc785\ub2c8\ub2e4.", "unique_key": 1583979316}
The result comes out and all I need is the unique_key's Velu, 1583979316, so how can I take out the Velu only and use it?
success: function(data) {
alert(data);
let test2 = data[unique_key];
let form_data = {_unique_key: test2}
if (test2 != null){
$.ajax({
type: 'post',
url: "Example code empty",
dataType: "text",
timeout: 1000,
data: form_data,
error: function(request, status, error){
alert ("Fail");
console.log(request, status, error);
},
success: function(data) {
console.log(data)
}
});}
I'm not sure if you're asking this, but do you know? Whether to catch a mouse with the back foot of a cow 😆
JSON.parse(
'{"msg": "\uac80\uc0c9\uc911\uc785\ub2c8\ub2e4.", "unique_key": 1583979316}'
).unique_key; // 1583979316
© 2024 OneMinuteCode. All rights reserved.