日期:2014-05-16  浏览次数:20403 次

JS的问题,小问题,速来抢分!
JScript code
 
function loadcalendar() {
s = '';
s += ' <div id="calendar"  style="display:none; position:absolute; z-index:9;" onclick="_cancelBubble(event)">';
if (ie)
{
s += ' <iframe width="159" height="111" src="about:blank" style="position: absolute;z-index:-1;"> </iframe>';
}
s += ' <div class="div" style="position:absolute; z-index:1000"> <table border: 1px; cellspacing="0" cellpadding="0" width="100%" style="text-align: center">';
s += ' <tr height="1">&nbsp; <tr> <tr align="center" class=""> <td class="header"> <a href="#" class="prev" onclick="refreshcalendar(yy, mm-1);return false" title="上一月">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td> <td colspan="5" style="text-align: center" class="header"> <a href="#" onclick="showdiv(\'year\');_cancelBubble(event);return false" title="点击选择年份" id="year"> </a>  -  <a id="month" title="点击选择月份" href="#" onclick="showdiv(\'month\');_cancelBubble(event);return false"> </a> </td> <td class="header"> <A href="#" class="next" onclick="refreshcalendar(yy, mm+1);return false" title="下一月">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </A> </td> </tr>';
s += ' <tr class="category"> <td>日 </td> <td>一 </td> <td>二 </td> <td>三 </td> <td>四 </td> <td>五 </td> <td>六 </td> </tr>';
for(var i = 0; i < 6; i++) {
s += ' <tr class="altbg2">';
for(var j = 1; j <= 7; j++)
s += " <td id=d" + (i * 7 + j) + " height=\"19\"> </td>";
s += " </tr>";
}
s += ' <tr id="hourminute"> <td colspan="7" align="center"> <input type="text" size="1" value="" id="hour" onKeyUp=\'this.value=this.value > 23 ? 23 : zerofill(this.value);controlid.value=controlid.value.replace(/\\d+(\:\\d+)/ig, this.value+"$1")\'> 点 <input type="text" size="1" value="" id="minute" onKeyUp=\'this.value=this.value > 59 ? 59 : zerofill(this.value);controlid.value=controlid.value.replace(/(\\d+\:)\\d+/ig, "$1"+this.value)\'> 分 </td> </tr>';
s += ' </table> </div> </div>';
s += ' <div id="calendar_year" onclick="_cancelBubble(event)"> <div class="col">';
alert("1");
for(var k = 1930; k <= 2019; k++) {
s += k != 1930 && k % 10 == 0 ? ' </div> <div class="col">' : '';
s += ' <a href="#" onclick="refreshcalendar(' + k + ', mm);$(\'calendar_year\').style.display=\'none\';return false"> <span' + (today.getFullYear() == k ? ' class="today"' : '') + ' id="calendar_year_' + k + '">' + k + ' </span> </a> <br />';
}
s += ' </div> </div>';
s += ' <div id="calendar_month" onclick="_cancelBubble(event)">&