Hello everyone,
I very new to jquery and jquery mobile.
I have a select menu
- <div id="myContent" data-role="content" height="300" class="grey">
- <div data-role="fieldcontain">
<select name="selectZone" id="selectZone" data-theme="c"></select>- </div>
- </div>
This menu is filled with options like this:
- $(document).ready( function(){
- $.ajax({
- type: "GET",
- url: "xml/zones.xml",
- dataType: "xml",
- success: function(xml) {
- $(xml).find('zone').each(
- function()
- {
- var id = $(this).attr('id');
- var name = $(this).find('name').text();
- $('<option value="' + id + '">' + name + '</option>').appendTo("#selectZone");
- });
- }
- }); //end ajax
- $("#selectZone").selectmenu('refresh',true);
- } //end function
-
- );//end ready
but my selectmenu is not updated.
I'm sure that the xml is correctly giving an output as if I append it to a div in stead of the #selectZone, I get the content displayed correctly.
What am I doing wrong?
Thanks a lot for your help