Action after window.close()

自作多情 提交于 2019-12-11 12:47:41

问题


I have some troubles with javascript. I would like to do an action after closing a popup window

    <script type="text/javascript">
        window.close()
        window.opener.document.getElementById("login").modal('hide');
    </script>

"window.opener.document.getElementById("login")" this part is recognize in the console, but not the modal function : "Uncaught TypeError: window.opener.document.getElementById(...).modal is not a function(…)"

I was thinking it's because jquery is not called before my code, so I added before juste in case :

<%= javascript_include_tag "application" %>
<script type="text/javascript">
  window.opener.document.getElementById("login").modal('hide');
  window.close();
</script>

but it's still not working. Can you see where is the problem ?

来源:https://stackoverflow.com/questions/36326929/action-after-window-close

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!