Jquery mobile choice from json -


i getting json data , show in html, in fieldset radio choices when show html code puts "undefined". here code, thank you:

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);          

one of properties of json object missing. need fix missing double quote:

change

str_html += '<label for="radio-choice-h-' + item.subname + '>no</label>' 

into

str_html += '<label for="radio-choice-h-' + item.subname + '">no</label>' 

my guess combination of 'undefined' property unclosed attribute causing 'undefined' show in html


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -