iPad safari modalpopup问题

pm8*_*m86 7 javascript ipad ios4

我正在开发一个与iPad兼容的Web应用程序.

之前我在iOS 3.2版上进行了测试,所有模态对话框弹出窗口都正常返回父窗口的值.但在将我的iOS升级到4.3之后,它表现得很奇怪.现在,在iPad上,它返回一个值,但是在我点击另一个字段或同一字段(HTML文本字段)之前不会更新该字段.

我正在使用window.open()打开模态弹出窗口;

并使用window.opener.oaEventiPad(retValArray)返回; oaEventiPad是负责设置更新值的功能.

有人可以帮忙吗?

谢谢,

Kam*_*ran 0

我也经历过类似的问题。我在我的 asp .net 应用程序中打开一个弹出窗口,该窗口应该与 iPad 兼容。当我使用 IE、Chrome、FireFox 和 Safari(在 Windows 7 的 PC 上)时,已成功返回值。

不幸的是,当我通过 iPad 访问该应用程序时,相同的代码在 Safari 中失败。在 iPad 上,domObject 会在新窗口打开时提示,而不是在新窗口关闭时提示返回值。

下面是代码。父窗口:

enter code here


<script type="text/javascript">

        function modalWin() {
            //alert('clicked');
            if (window.showModalDialog) {
                retVal = window.showModalDialog("About.aspx", "name", "dialogWidth:255px;dialogHeight:250px");
                alert(retVal);
            }
            else {
                retVal = window.open('About.aspx', 'name', 'height=255,width=250,toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no ,modal=yes');
                alert(retVal);
            }

        }
    </script>
//HTML
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<a title="Test New Popup" onclick="modalWin();">New Popup for all browsers.</a>.
</asp:Content>
Run Code Online (Sandbox Code Playgroud)

新一页:

     <script type="text/javascript">
        function closeIt(tempValue) {
            window.returnValue = tempValue;
            window.close();
        }
    </script>
//HTML:
 <input id="btnButton1" value="btnButton1" type="button" title="Press it to Close" onclick="closeIt('btnButton1');" />
    <br />
    <input id="btnButton2" value="btnButton2" type="button" title="Press it to Close" onclick="closeIt('btnButton2');" />
    <br />
    <input id="btnButton3" value="btnButton3" type="button" title="Press it to Close" onclick="closeIt('btnButton3');" />
Run Code Online (Sandbox Code Playgroud)