douqiu1604 2014-07-10 06:27
浏览 84
已采纳

JS opener.parent不会在ipad safari浏览器上触发

I was trying "this.opener.parent.doXero();" to call a function in the parent page and it works fine on desktop browsers. Unfortunately, it doesn't work on Ipad safari browser. Is there any solution for this matter?

My main page (index.php) has a link to open XERO authentication page (xero.php). Xero callback to xero.php and I have put the code below on the page. doXero function located in the index.php page.

<script>
    this.opener.parent.doXero();
    this.close();
</script>
  • 写回答

1条回答 默认 最新

  • duanmianxue2687 2014-07-14 01:44
    关注

    I found a solution for this. Hope this would help someone else too. Use following code under button/link event trigger.

    var win = window.open('yourpage.html');
                var timer = setInterval(function() {   
                    if(win.closed) {  
                        clearInterval(timer);  
                        functionToCall();  
                        }  
                }, 1000);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?