Javascript window.open Calling Twice
<p>I'm using this code in a php conditional if/else statement to open a new window.</p>

<pre><code>echo("&lt;script type=\"text/javascript\"&gt;
&lt;!--
window.open(\"http://www.example.com/index.php?$var\");
//--&gt;
&lt;/script&gt;
");
</code></pre>

<p>It's opening 2 windows instead of one, but only on my live site (on a dedicated server) and not on the test site (shared server).</p>

<p>EDIT: From zebediah49's suggestion, I appended a random int variable after the new window url. It changes the variable with each new window instance, so I assume that means that it runs the conditional twice. I probably should mention that it's using Joomla and a 3rd-party community app, JomSocial.</p>

<p>Alright, as I was editing this and after ~5min of the same window being open, it opened a brand new instance of the window.open window. So obviously it automatically refreshes once as soon as it lands. I'll have to pry into that. Still any suggestions are welcome.</p>

<p>Thank you for your tips regarding language and best practices.</p>
