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

Window.opener问题,框架是否算子窗口???
<iframe   height= "0 "   width= "0 "   src= "fig_page.asp "   id= "pic_frame "> </iframe>
<label> 广告投放类型:
        <select   name= "PutType "   id= "PutType "     style= "width:60px "   onchange= "Pic_Change1() ">
<option   value= " "> 请选择 </option>
  <%  
    Sqlt= "Select   *   From   AdType "
set   Rsm=Server.CreateObject( "ADODB.RecordSet ")
Rsm.Open   Sqlt,Conn,1,3
Do   While   Not   Rsm.Eof  
    %>
            <option   value= " <%=   Rsm( "ID ")   %> "> <%=   Rsm( "PutType ")   %> </option>
            <%  
    Rsm.MoveNext
Loop
Rsm.Close
Set   Rsm=Nothing
      %>
            </select>
        </label>

函数Pic_change1():
  function   Pic_Change1()
    { var   sValue;
    sValue=document.frm_pic.PutType.options[frm_pic.PutType.selectedIndex].value;
    if(sValue!= " ")
{
document.frames[ "pic_frame "].location.replace( "fig_page.asp?id= "+sValue);}

想达到的效果是当下拉菜单选择一个值时触发fig_page.asp页面,fig_page.asp页面根据传过来的值自动算过期时间,fig_page.asp页面脚本代码如下,
<script   type= "text/javascript ">
<!--
  var   today=new   Date();
  var   s;
today.setDate(today.getDate()+ <%=   putValue   %> );//putValue是从数据库中取得的值
s=today.getYear()+((today.getMonth()+1)> 9? "- ": "-0 ")+(today.getMonth()+1)+((today.getDate()+1)> 9? "- ": "-0 ")+today.getDate();
document.write(s);
window.opener.frm_pic.EndTime.value=s;
//window.opener.location.reload();
-->
</script>
现在的错误是 "window.opener.frm_pic "   为空或不是对象,是不是框架不能用Window.opener??s倒是可以正常显示

------解决方案--------------------
将window.opener改为parent