【发布时间】:2020-03-16 23:07:56
【问题描述】:
尝试附加单选按钮但显示 [object Object]。我的代码可能有什么问题?
.append('<li>'+JSON.parse(data.responseText).question+' ('+JSON.parse(data.responseText).score+'pts)
'+$.each(JSON.parse(data.responseText).choices, function(key, value){
{{Form::radio("radio", "value", ["class" => "form-control"])}}'
})+' ');
控制台
choices: Array(4)
0: {id: 121, quiz_question_id: 91, choice: "B", created_at: "2019-11-21
05:35:42", updated_at: "2019-11-21 05:35:42"}
1: {id: 122, quiz_question_id: 91, choice: "G", created_at: "2019-11-21
05:35:42", updated_at: "2019-11-21 05:35:42"}
2: {id: 123, quiz_question_id: 91, choice: "C", created_at: "2019-11-21
05:35:42", updated_at: "2019-11-21 05:35:42"}
3: {id: 124, quiz_question_id: 91, choice: "C1", created_at: "2019-11-21
05:35:42", updated_at: "2019-11-21 05:35:42"}
length: 4
【问题讨论】:
标签: javascript jquery json laravel laravel-6