我使用toLocaleString()
方法在`javascript输入钱逗号.但问题是,除了Safari浏览器外,IE和Chrome浏览器的结果是正确的.我删除缓存几次但仍然无法正常工作.你能帮我吗?;)
var test = 12300;
console.log('test:'+test.toLocaleString());
// 12,300 in IE,Chrome
// 12300 in Safari
Run Code Online (Sandbox Code Playgroud) 我按照以下链接使用日期选择器制作了“月历”。当我点击按钮时,日历出来并显示月份和年份。这是我的问题。有谁知道怎么改这个顺序?
从1.month 2.year到1.year 2.month
http://develop-for-fun.blogspot.kr/2013/08/jquery-ui-datepicker-month-and-year.html
$(function () {
$('#MainContent_txtMonth').datepicker({
changeYear: true,
changeMonth: true,
showButtonPanel: true,
dateFormat: 'yy-mm',
monthNamesShort: ['1?','2?','3?','4?','5?','6?','7?','8?','9?','10?','11?','12?'],
showOn: "button",
buttonImage: "img/button_calendar.jpg",
buttonImageOnly: true
}).focus(function() {
var thisCalendar = $(this);
$('.ui-datepicker-calendar').detach();
$('.ui-datepicker-close').click(function () {
var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
thisCalendar.datepicker('setDate', new Date(year, month, 1));
});
});
});
Run Code Online (Sandbox Code Playgroud)