Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
json中的Jquery移动选项_Jquery_Jquery Mobile - Fatal编程技术网

json中的Jquery移动选项

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.

我正在获取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.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+='var
str_html=''。仅使用一个,为什么使用两个?可能重复的
str_html += '<label for="radio-choice-h-' + item.subname + '">No</label>'