jquery datepickerプラグインは機能しますが、新しいタブでページを開く関数をonSelectでトリガーしたいと思います。
jquery datepickerプラグインは機能しますが、新しいタブでページを開く関数をonSelectでトリガーしたいと思います。
$("#dp").datepicker({
beforeShowDay: highlightDays,
//works perfectly fine
onSelect: function(dates) { window.open('/en/calendar/' + dates, '_self'); },
});
var dates = [new Date(2011, 4 - 1, 28), new Date(2011, 5 - 1, 10),];
//does not work
onSelect: function(links) { window.open('/en/trip/' + links, '_self'); },
var links = [new Link('link1'), new Link('link2'),];
js:
$( "#toggleDP" ).click(function() { $("#dp ").datepicker('show'); });
$("#dp").datepicker({
changeMonth: true,
changeYear: true,
showOn: 'button',
showButtonPanel: true,
buttonImageOnly: true,
buttonImage: "0.gif",
dateFormat: 'yy-mm-dd',
beforeShowDay: highlightDays,
onSelect: function(dates) { window.open('/en/calendar/' + dates, '_self'); },
});
var links =[new Link('test'), new Link('test1'), ];
var dates = [new Date(2011, 4 - 1, 28), new Date(2011, 5 - 1, 10), ];
var txt = ['test','test1',];
function highlightDays(date) {
for (var i = 0; i < dates.length; i++) {
if (dates[i]-date==0) {
return [true, 'markedDay', txt[i],];
}
}
return [false, ''];
}
onSelectをfunction(links){window.open('/ en / trips /'+links、'_self');に設定した場合 }、その後、いくつかの未知の理由で、対応するリンクではなく、対応するDATEでURLを開きます。