包含框架的showmodaldialog窗口 访问打开者页面的JavaScript解决方案

打开者页面:(index.html)

  <script type="text/javascript" >
    function OpenDialog()
    {
        showModalDialog("dialog.html",window,"dialogWidth=700px;dialogHeight=400px;");
    }
    function Changing()
    {
        document.getElementById("god").value="能打开?";
    }
  </script>

<input type="button" id="god" value="打开" onclick="OpenDialog();" >

 

 

dialog.html 页面:

<iframe name="god" src="oprater.html" frameborder="0" height="400px" width="600px"></iframe>

 

 

 

oprater.html框架内的页面:

<script type="text/javascript" >
    function grandParent()
    {
        parent.window.dialogArguments.Changing();
    }
  </script>

<input type="button" value="换原来的值" onclick="grandParent();" >

你可能感兴趣的:(showModalDialog)