json中的Jquery移动选项
我正在获取JSON数据并以HTML显示,在json中的Jquery移动选项,jquery,jquery-mobile,Jquery,Jquery Mobile,我正在获取JSON数据并以HTML显示,在fieldset中使用无线电选项,但当我显示HTML代码时,会显示“未定义”。这是我的代码,谢谢你: var str_html; var str_html; str_title = item.title || null; str_title = item.title || null; str_subtitle = item.quest || null; str_image = item.image || null; a_paragraph = item.
fieldset
中使用无线电选项,但当我显示HTML代码时,会显示“未定义”。这是我的代码,谢谢你:
var str_html;
var str_html;
str_title = item.title || null;
str_title = item.title || null;
str_subtitle = item.quest || null;
str_image = item.image || null;
a_paragraph = item.paragraph || null;
str_html = '<fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">';
str_html += '<legend>' + item.subtitle + '</legend>';
str_html += '<input name="radio-choice-h-' + item.id + '" id="radio-choice-h-' + item.id + '" value="on" checked="checked" type="radio" >';
str_html += '<label for="radio-choice-h-' + item.name + '>Si</label>'
str_html += '<input name="radio-choice-h-' + item.id + 'b" id="radio-choice-h-' + item.id + '" value="on" checked="checked" type="radio" >';
str_html += '<label for="radio-choice-h-' + item.subname + '>No</label>'
str_html += '</fieldset>';
$page.find("#test_container").append(str_html);
var str_html;
var str_html;
str_title=item.title | | null;
str_title=item.title | | null;
str_subtitle=item.quest | | null;
str_image=item.image | | null;
a_段落=项。段落| |空;
str_html='';
str_html+=''+item.subtitle+'';
str_html+='';
str_html+=“否”
str_html+='';
$page.find(“#test_container”).append(str_html);
可能缺少JSON对象的一个属性。
您还需要修复缺少的双引号:
改变
str_html += '<label for="radio-choice-h-' + item.subname + '>No</label>'
str_html+='varstr_html=''代码>。仅使用一个,为什么使用两个?可能重复的
str_html += '<label for="radio-choice-h-' + item.subname + '">No</label>'