【发布时间】:2014-01-19 09:02:17
【问题描述】:
我需要在 Rails 上 10 秒内关闭浏览器窗口。我在名为 callback.html.erb 的 Rails 视图文件中尝试了此代码。这是我的代码。
<center>
<p>
Your profile has been processed. This browser window will close in 10 seconds
</p>
</center>
<script type="text/javascript">
function closeWindow()
{
setTimeout
(
function()
{
window.close();
},10000
);
}
window.onload = closeWindow();
</script>
它似乎没有工作(没有真正发生)。知道我哪里错了吗?
提前致谢!
【问题讨论】:
标签: javascript html ruby-on-rails