Bootstrap Modal Dialog ボックス (Bootstrap 3.0) 内で Bootstrap Datepicker を使用しようとしています。Chrome ブラウザーを使用している場合、日付ピッカーはまったく表示されませんが、以下のコードに示すように確認ステートメントまたは警告ステートメントが挿入された場合にのみ、Internet Explorer で適切に表示されます。
var GetDate = function () {
BootstrapDialog.show({
title: "Go To Date",
message: '<div><input id="StartDate" type="text" /></div',
draggable: true,
closable: false,
cssClass: 'login-dialog',
buttons: [{
label: "Return Date",
action: function (dialogRef) {
alert($("#StartDate").val().toLocaleString());
dialogRef.close();
}
}]
});
// The code only works on IE9, IE10 and IE11 with the following line
confirm();
var dp = $("#StartDate");
dp.datepicker({
format: "dd/mm/yyyy",
todayBtn: "linked",
autoclose: true,
todayHighlight: true,
language: "en"
});
}
<input id="Button1" type="button" value="button" onclick="GetDate();" />
なぜこれが起こっているのか、この問題を解決する方法を教えてもらえますか?