I need to close a browser window in 10 seconds on rails. I tried this code in a rails view file called callback.html.erb. Here's my code.
<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>
It doesn't seem to be working(Nothing really happens). Any idea on where I'm wrong?
Thanks in advance!