高手帮我解决一个非常简单的问题...............

jenry_leon 2004-10-05 08:59:18

请高手帮我,我想点击日历的某一天,然后把该天的年,月,日传送到jsp页面,或action中!
下面的代码可以看到页面,但还没有实现联接,请高手帮我啊!.............
谢谢!
谢谢!
谢谢!

<html>
<body>
<!-- Blog日历表开始 -->
<script language="javascript">
var diarydays="<2004-08-15><2004-08-13><2004-08-12><2004-08-11><2004-08-10><2004-08-09><2004-08-08>;
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
.calendarBigBorder { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; text-decoration: none; width: 170; background-color: #FFFFFF; font-size: 9pt;border:1px dotted #999; }
.calendarTd { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; font-size: 9pt; color: #000000; background-color: #eeeeee; height: 18px; width: 11%; text-align: center;}
.calendarMInput { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; font-size: 9pt; text-decoration: none; background-color: #FFFFFF; height: 15px; border: 1px solid #666666; width: 19px; color: #0099FF;}
.calendarYInput { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; font-size: 9pt; color: #0099FF; text-decoration: none; background-color: #FFFFFF; height: 15px; width: 34px; border: 1px solid #666666;}
.calendarMonthTitle { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; font-size: 9pt; font-weight: normal; height: 24px; text-align: center; color: #333333; text-decoration: none; background-color: #eeeeee; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-bottom-style: none; border-top-color: #999999; border-right-color: #999999; border-bottom-color: #999999; border-left-color: #999999;}
.calendarNow { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; font-size: 9pt; font-weight: bold; color: #000000; background-color: #C0C9D3; height: 18px; text-align: center;}
.calendarDaySat { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; font-size: 9pt; color: #333333; text-decoration: none; background-color: #eeeeee; text-align: center; height: 18px; width: 12%;}
.calendarDaySun { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; font-size: 9pt; color: #333333; text-decoration: none; background-color: #eeeeee; text-align: center; height: 18px; width: 12%;}
.calendarLink { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; font-size: 9pt; font-weight: normal; color: #333333; text-decoration: none; background-color: #E7E7F6; text-align: center; height: 18px;}
.categoryTxt { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; font-size: 9pt; line-height: 23px; color: #333333; text-decoration: none;}
.categoryTable { border-right-width: 1px; border-bottom-width: 1px; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-right-color: #000000; border-bottom-color: #000000; border-top-width: 1px; border-top-style: solid; border-top-color: #71b99c;}
</style>
<SCRIPT LANGUAGE="JavaScript">
var months = new Array("一", "二", "三","四", "五", "六", "七", "八", "九","十", "十一", "十二");
var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31,30, 31, 30, 31);
var days = new Array("日","一", "二", "三","四", "五", "六");
var classTemp;
var calendarHover="calendarHover";
var today=new getToday();
var year=today.year;
var month=today.month;
var newCal;
//得到某月天数
function getDays(month, year)
{ if (1 == month)
return ((0 == year % 4) && (0 != (year % 100))) ||(0 == year % 400) ? 29 : 28;
else
return daysInMonth[month];
}
//得到当天时间信息
function getToday()
{ this.now = new Date();
this.year = this.now.getFullYear();
this.month = this.now.getMonth();
this.day = this.now.getDate();
}

//生成日历
function Calendar()
{ newCal = new Date(year,month,1); //当前月的第一天
today = new getToday();
var day = -1; //用来判断日历中是否为当天
var startDay = newCal.getDay(); //当月开始时间
var endDay=getDays(newCal.getMonth(), newCal.getFullYear());//当月结束时间
var daily = 0; //用来生成日历中的天数值
if ((today.year == newCal.getFullYear()) &&(today.month == newCal.getMonth()))
day = today.day;
var caltable = document.all.caltable.tBodies.calendar; //得到日历表格的集合
var intDaysInMonth =getDays(newCal.getMonth(), newCal.getFullYear()); //得到当月天数
//生成日历
for (var intWeek = 0; intWeek < caltable.rows.length;intWeek++)
for (var intDay = 0;intDay < caltable.rows[intWeek].cells.length;intDay++)
{
var cell = caltable.rows[intWeek].cells[intDay]; //得到单元袼
//生成字符串用于判断当天是否有日志
var montemp=(newCal.getMonth()+1)<10?("0"+(newCal.getMonth()+1)):(newCal.getMonth()+1);
if ((intDay == startDay) && (0 == daily)){ daily = 1;}
var daytemp=daily<10?("0"+daily):(daily);
var d="<"+newCal.getFullYear()+"-"+montemp+"-"+daytemp+">";
//选择样式
if(day==daily)
cell.className="calendarNow";
else if(diarydays.indexOf(d)!=-1)
cell.className="calendarLink";
else if(intDay==6)
cell.className = "calendarDaySat";
else if (intDay==0)
cell.className ="calendarDaySun";
else
cell.className="calendarTd";
//生成值
if ((daily > 0) && (daily <= intDaysInMonth))
{ cell.innerText = daily;
daily++;
}
else
cell.innerText = "";
}
document.all.year.value=year;
document.all.month.value=month+1;
}

function subMonth()
{
if ((month-1)<0)
{
month=11;
year=year-1;
}
else
{
month=month-1;
}
Calendar();
}
function addMonth()
{
if((month+1)>11)
{
month=0;
year=year+1;
}
else
{
month=month+1;
}
Calendar();
}
//得到响应事件
function getDiary()
{
var mon=(newCal.getMonth()+1)<10?("0"+(newCal.getMonth()+1)):(newCal.getMonth()+1);
var day=event.srcElement.innerText<10?("0"+event.srcElement.innerText):(event.srcElement.innerText);
var d="<"+newCal.getFullYear()+"-"+mon+"-"+day+">";
if ("TD" == event.srcElement.tagName)
if (("" != event.srcElement.innerText)&&(diarydays.indexOf(d)!=-1))
{
diary.location="/chensheng913/archive/"+newCal.getFullYear()+"/"+mon+"/"+day+".aspx";
window.location.href = diary.location;
}
}
function setDate()
{
if (document.all.month.value<1||document.all.month.value>12)
{
alert("月的有效范围在1-12之间!");
return;
}
year=Math.ceil(document.all.year.value);
month=Math.ceil(document.all.month.value-1);
Calendar();
}
</SCRIPT>

...全文
63 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
ouyld 2004-10-07
  • 打赏
  • 举报
回复
flingpig 2004-10-06
  • 打赏
  • 举报
回复
哦,谢谢大哥,你贴的代码太多了,估计没几个人会帮你做
jenry_leon 2004-10-06
  • 打赏
  • 举报
回复
啊!那就难了!
5555555555
jenry_leon 2004-10-05
  • 打赏
  • 举报
回复
<table border="0" cellpadding="0" cellspacing="1" class="calendarBigBorder" id="caltable" width="200">
<thead>
<tr align="center" valign="middle">
<td colspan="7" class="calendarMonthTitle">
<input name="year" type="text" class="calendarYInput" size="3" maxlength="4" onkeydown="if (event.keyCode==13){setDate()}" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" onpaste="this.value=this.value.replace(/[^0-9]/g,'')">年
<input name="month" type="text" class="calendarMInput" size="1" maxlength="2" onkeydown="if (event.keyCode==13){setDate()}" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" onpaste="this.value=this.value.replace(/[^0-9]/g,'')">月 [<a onClick="addMonth()" href="javascript:;">下月</a>] [<a onClick="subMonth()" href="javascript:;">上月</a>]</td>
</tr>
<tr align="center" valign="middle">
<SCRIPT LANGUAGE="JavaScript">
document.write("<TD class=calendarDaySun id=diary>" + days[0] + "</TD>");
for (var intLoop = 1; intLoop < days.length-1;
intLoop++)
document.write("<TD class=calendarTd id=diary>" + days[intLoop] + "</TD>");
document.write("<TD class=calendarDaySat id=diary>" + days[intLoop] + "</TD>");
</SCRIPT>
</TR>
</thead>
<TBODY border=1 cellspacing="0" cellpadding="0" ID="calendar" ALIGN=CENTER ONCLICK="getDiary()" onmouseup=document.selection.empty() oncontextmenu="return false" onselectstart="return false" ondragstart="return false" onbeforecopy="return false" oncopy=document.selection.empty() onselect=document.selection.empty()>
<SCRIPT LANGUAGE="JavaScript">
for (var intWeeks = 0; intWeeks < 6; intWeeks++) {
document.write("<TR style='cursor:hand'>");
for (var intDays = 0; intDays < days.length;intDays++)
document.write("<TD class=calendarTd onMouseover='{classTemp=this.className;this.className=calendarHover}' onMouseOut='this.className=classTemp'></TD>");
document.write("</TR>");
}
</SCRIPT>
</tbody>
</table>
<script LANGUAGE="JavaScript">
Calendar();
</script>
<!-- Blog日历表结束 -->
</body>
</html>

谢谢大哥...
Domain4.3(明小子)10.10.10更新版主要更新内容如下: 1.驱除部分死连接,恢复部分官方连接 2.改变默认显示页面为本人BLOG 3.修正程序在检测时出错的BUG 4.修正程序在部分系统中无法启动的BUG 5.加了一个功能模块,但还不成熟,隐藏了,高手的话可以用OD调出来!>!< 6.修复前段时间一些朋友反映的错误和程序宏 7.增加四款SKN皮肤! 10.10.11紧急更新: 1.修正新版程序在部分系统中启动后直接导致系统蓝屏的BUG 2.修正域名查询的几个错误 3.修正程序批量检测查询到域名的时候无反映的BUG! Domain4.2(明小子)10.01.16更新版主要更新内容如下: 1.删除所有无关数据 2.优化急速代码 3.改变启动线程 4.增加SQL数据批量导出功能 5.加入几个优化进程模块,非后门.后台运行. 6.锁定主程序栏目宽和高,不在恢复 7.删除“辅助工具”模块中全部代码 8.修正XP SP3 程序下兼容问题 9.重新改写域名查询旁站线程 程序于2010年01月16号调试完毕! 提别提示:第4个功能只能运行在完整版的windows XP 平台系统中,其他平台无法运行,如果出现恢复按钮并不能保存请自行调试与本程序无关.谢谢合作! 宝宝的话:有朋友们的鼓励才会有这个版本的发布,这当是我送给大家2010年里的第一个礼物吧。 Domain4.1(明小子)0901更新版主要更新内容如下: 1.增加新系统兼容模块,全面兼容2000-2008各系统 (部分精简版系统除外) 2.优化网站打开速度,删减部分无用内核信息,全面加快程序启动速度. 3.基于09.05.20号内核提升,改变搜查循环的一个死BUG! 4.删除在0520上增加的一个补针函数,并使用新的函数替换.保证不报错. 5.不在兼容xpsp3,因为没时间去修正这个错误。所以可能部分SP3系统运行不起来本程序 6.增加部分程序扩充空格代码,为下个版本更新做好铺垫 小提示:保留旧的IP反查连接系统,原因没有找到新的和稳定的IP反差服务器!如果有能提供的请与本人联系!谢谢合作 Domain4.1(明小子)0520更新版主要更新内容如下: 1.基于08.10.01号内核提升,修正一次关键错误。 2.替换原程序自带的那个小马,该为最新美化免杀版的小马! 3.添加一个服务器挂钩程序(非插件),使修改后的新内核兼容vista系统。 4.程序数据库默认名为:SetData.mdb 请大家使用3.5版本以上的MDB数据.其他低版本程序可能不兼容! 5.删除后台下载统计代码(以前没发现,本人也是从网站上面下的软件,排除作者自添加行为) 6.加了一个补针,针对sql注入功能中的一个小BUG。 7.删除了很多没有用的代码,最大限度的优化程序启动速度。 8.更新部分在xpsp3下出错的几个小BUG(小问题解决,这个错误仅针对部分优化过度的XPSP3系统)。 提记:很多朋友说需要修改下程序IP域名查询功能,这里说明下.由于内核找不到关键句柄导致无法更新,下个版本在仔细看看! Domain4.0(明小子)1001更新版主要更新内容如下: 1.更新部分过度优化过的系统不兼容问题。 2.修改内存识别函数,使其降低软件在使用期间所占用的内存大小。 3.基于08.09.15号内核提升,修正因修改软件所出现的几个导致软件崩溃的几个BUG。 4.换了软件自带的那个垃圾皮肤。加入兼容美化皮肤!更美观! 5.兼容前版本数据库支持功能 6.去掉了没有用的PHP入侵选项和几处小BUG...... 转贴是一种美德!分享也是一种快乐,工具仅做辅助作用请勿用在非法用途上! 程序自带本BLOG连接,启动比较慢!不喜勿用!谢谢合作!

87,907

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧