var a = window.opener.document.getElementById("MainContent_btnImportWebSite").style.display='none' ; 
为什么没效果var a = window.opener.document.getElementById("MainContent_txtSKU").value='xxx';
一样也是报错 
信息为:window.opener.document 为空或不是对象

解决方案 »

  1.   

    var a = document.getElementById("MainContent_btnImportWebSite").style.display='none'
    你是想干什么啊。。前面为什么要加  window.opener.
      

  2.   

    window.opener.document.getElementById("MainContent_txtSKU").value='xxx';
    window.opener.document.getElementById("MainContent_btnImportWebSite").style.display='none' ; 
    直接这么写有错?
      

  3.   


    回楼上的话,这样写就报错,错误信息提示为空或不是对象,肯定是对的呀,我在父面面是asp.net控件, 难道只能对html控件才有作用?还是我代码写的有问题?
      

  4.   

    window.opener  难道一定要是 父页面要以 window.open() 的方式打开的子页面才能这样赋值吗??
      

  5.   

    iframe  是 window.parent.document