jquery mobile select
Ran into an issue where the select wasn't updating on Safari. Note the selectmenu('refresh') method.
HTML
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css">
<script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
<select name="otherAccountPaymentOptionsSelect" id="choosePaymentAccountSelect" class="choosePaymentAccountSelectClass" data-native-menu="false">
<option value="paymentAccounts" data-placeholder="true">Choose Account</option>
<option value="default">Default Account</option>
<option value="credit">Credit Card</option>
</select>
JavaScript
var a = [act1,act2,act3,act4],
options = '';
for (var i = 0; i < 20; i++) {
a.push(i);
}
$.each(a, function(i, o) {
options += i === 3 ? '<option value="' + o + '" selected="selected">' + o + '</option>' : '<option value="' + o + '">' + o + '</option>';
});
var $OtherAccountValue = 'other' + i;
var $OtherAccountName = 'Saved Account ' + i;
var $Payment_Account_Select_Option = $('<option value="' + $OtherAccountValue + '">' + $OtherAccountName + '</option>');
//APPEND ACCOUNT SELECT LIST
//$('#choosePaymentAccountSelect').append($Payment_Account_Select_Option).listview('refresh');
$('#choosePaymentAccountSelect').html($Payment_Account_Select_Option).val(9).selectmenu('refresh');
//$('select')[0].options.length = 0;
//$('select').html(options).val(9).selectmenu('refresh');
//$('select').empty().append(options);