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);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥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 支付宝网页转账系统不识别账号