How do you stop this from continuing on ad infinitum? Each time you open the new window with the same URL, it'll have the same Javascript code to open a new window and close the old one. So, it'll open a new window, same URL, and close itself, while the new window is doing the same thing, etc. You'll need to pass some parameter in the URL to get it to stop after the first cycle.
Ok, thanks for that bit of coding, I have it now below:
<html>
<head>
<script>
function jim()
{
if (document.body.ClientWidth != 380)
{
var x = location.href; window.open(x,'mywindow','Width=400,height=400');
}
}
</script>
</head>
<BODY onload="jim()";>
</body>
</html>
This opens up a new window, but as TROLLACIOUS points out, it just keeps on cyling through it. I tried to use the IF command above, but it keeps doing it, so questions are:
A) Is it the orignal page making it recycle itself or is it the newly opened one which is doing it.
B) How do I stop it Cycling through itself as that if command does not want to stop it.
Ok, thanks for that bit of coding, I have it now below:
<html>
<head>
<script>
function jim()
{
if (document.body.ClientWidth != 380)
{
var x = location.href; window.open(x,'mywindow','Width=400,height=400');
}
}
</script>
</head>
<BODY onload="jim()";>
</body>
</html>
This opens up a new window, but as TROLLACIOUS points out, it just keeps on cyling through it. I tried to use the IF command above, but it keeps doing it, so questions are:
A) Is it the orignal page making it recycle itself or is it the newly opened one which is doing it.
B) How do I stop it Cycling through itself as that if command does not want to stop it.
C) How do I close that other window (espically since its the same as the new window, I think i need lots of IF commands here!)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.