日期:2014-05-18  浏览次数:20674 次

两张页之间的传值!
用jsp做了一张普通页和一份日历页面。在普通页上点击相应的框可以弹出日历页面。   然后可以在日历页面选择日期。
不知道有没有什么方法可以在日历页上直接点击日期,然后在普通页上显示此日期呢?

------解决方案--------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN ">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>

<BODY>
<script language= "javascript ">
function openScript(url, width, height){
var Win = window.open(url, "openScript ", 'width= ' + width + ',height= ' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes ' );}
</script>

<SCRIPT language= "javascript ">
var bMoveable=false; //设置日历是否可以拖动
var _VersionInfo= "Version:2.0 "
//2.0作者:walkingpoison
//1.0作者: F.R.Huang(meizz)
//MAIL: meizz@hzcnc.com


var strFrame; //存放日历层的HTML代码
document.writeln( ' <iframe id=meizzDateLayer Author=wayx frameborder=0 style= "position: absolute; width: 144; height: 211; z-index: 9998; display: none "> </iframe> ');
strFrame= ' <style> ';
strFrame+= 'INPUT.button{BORDER-RIGHT: #ff9900 1px solid;BORDER-TOP: #ff9900 1px solid;BORDER-LEFT: #ff9900 1px solid; ';
strFrame+= 'BORDER-BOTTOM: #ff9900 1px solid;BACKGROUND-COLOR: #fff8ec;font-family:宋体;} ';
strFrame+= 'TD{FONT-SIZE: 9pt;font-family:宋体;} ';
strFrame+= ' </style> ';
strFrame+= ' <scr ' + 'ipt> ';
strFrame+= 'var datelayerx,datelayery; /*存放日历控件的鼠标位置*/ ';
strFrame+= 'var bDrag; /*标记是否开始拖动*/ ';
strFrame+= 'function document.onmousemove() /*在鼠标移动事件中,如果开始拖动日历,则移动日历*/ ';
strFrame+= '{if(bDrag && window.event.button==1) ';
strFrame+= ' {var DateLayer=parent.document.all.meizzDateLayer.style; ';
strFrame+= ' DateLayer.posLeft += window.event.clientX-datelayerx;/*由于每次移动以后鼠标位置都恢复为初始的位置,因此写法与div中不同*/ ';
strFrame+= ' DateLayer.posTop += window.event.clientY-datelayery;}} ';
strFrame+= 'function DragStart() /*开始日历拖动*/ ';
strFrame+= '{var DateLayer=parent.document.all.meizzDateLayer.style; ';
strFrame+= ' datelayerx=window.event.clientX; ';
strFrame+= ' datelayery=window.event.clientY; ';
strFrame+= ' bDrag=true;} ';
strFrame+= 'function DragEnd(){ /*结束日历拖动*/ ';
strFrame+= ' bDrag=false;} ';
strFrame+= ' </scr ' + 'ipt> ';
strFrame+= ' <div style= "z-index:9999;position: absolute; left:0; top:0; " onselectstart= "return false "> <span id=tmpSelectYearLayer Author=wayx style= "z-index: 9999;position: absolute;top: 3; left: 19;display: none "> </span> ';
strFrame+= ' <span id=tmpSelectMonthLayer Author=wayx style= "z-index: 9999;position: absolute;top: 3; left: 78;display: none "> </span> ';
strFrame+= ' <table border=1 cellspacing=0 cellpadding=0 width=142 height=160 bordercolor=#ff9900 bgcolor=#ff9900 Author= "wayx "> ';
strFrame+= ' <tr Author= "wayx "> <td width=142 height=23 Author= "wayx " bgcolor=#FFFFFF> <table border=0 cellspacing=1 cellpadding=0 width=140 Author= "wayx " height=23> ';
strFrame+= ' <tr align=center Author= "wayx "> <td width=16 align=center bgcolor=#ff9900 style= "font-size:12px;cursor: hand;color: #ffffff " ';
strFrame+= ' onclick= "parent.meizzPrevM() " title= "向前翻 1 月 " Author=me