Javascript 数字格式化
jquery-numberformatter
http://code.google.com/p/jquery-numberformatter/
var winWidth = $(window).width();var winHeight = $(window).height();var x = (winWidth - 382)/2 + $(document).scrollLeft();var y = (winHeight - 280)/2 + $(document).scrollTop();
?
时间区转换
?
function calcTime(city, offset) {d = new Date();utc = d.getTime() + (d.getTimezoneOffset() * 60000);nd = new Date(utc + (3600000*offset));return "The local time in " + city + " is " + nd.toLocaleString();}alert(calcTime('Bombay', +5.5));alert(calcTime('Singapore', +8));alert(calcTime('London', +1));?把文本框焦点移动到文本最后
function setInputFocus(elementId){ var inputElement = document.getElementById(elementId); if(!inputElement){ return;} var textRange =inputElement.createTextRange(); textRange.moveStart('character',inputElement.value.length); textRange.collapse(true); textRange.select(); }