ブートストラップ選択ドロップダウンリストに1000レコードをロードしています。 Chromeでは約2秒かかりますが、IE 9では30秒かかります。また、IEのブートストラップモーダルをキャンセルするかxoutすると10秒もかかります。 APIコールはOKですが、レンダリングは非常に遅いです。ある人が私にある方向を教えてくれますか?ブートストラップの選択ロードがIEで長すぎます
私は顧客のリストを読み込み、選択したものを設定しています。ここにコードがあります。
使用できるvar customerPicker = $('#customer-picker');
API.getCustomers().then(function (result) {
loadDropdown(customerPicker, result.customers);
// set the selected to current customer; it takes 10s in IE
customerPicker.val(currentCustomerId).selectpicker('refresh');
// it takes about 10s in IE too. selector is the bs modal div
$(selector).css('z-index', '1060').modal('show');
}).catch(function (errorMessage) {
ToastManager.showError(errorMessage || 'An error occurred while loading customer list. Please try again.');
});
function loadDropdown($div, arr) {
var options = '';
$.each(arr, function (i, item) {
options = options + '<option value="' + item.Value + '">' + item.Text + '</option>';
});
$div.html(options);
}
大きな 'options'文字列を生成する代わりに' $ div.append( '
@RobinMackenzieええ私は運がなかったのです。 – Quentin
jQueryのどのバージョンを使用していますか?あなたがjsに直接言及しているので、異なるjQueryリリースを試すことでこれを解決できる可能性は非常に高いです。 –