Reputation: 10926
I'm using jquery mobile and have a select menu in my html markup like this:
<select id="theid">
<option>foo</option>
...
</select>
I actually would like to add some more options after an ajax call, so I do something like:
$('#theid').append(
$('<option val="42">').text('bar')
)
$('#theid').selectmenu('refresh');
But sometimes I get an error that says that the object has no method 'selectmenu'. Why is this happening?
Upvotes: 3
Views: 412
Reputation: 1664
try the following:
$('#theid').selectmenu('refresh', true);
http://forum.jquery.com/topic/how-to-add-items-and-refresh-the-select-menu-in-jquery-mobile
Upvotes: 1