title: using window.location with a simple html link
body: <p>Trying to make a <strong>simple</strong> HTML page with a some links on it, but trying to make it so it detects you are either local or using the SSH Port Forwarding.</p>
  
  <p>Some info;</p>
  
  <p>URL I use when accessing the webpage Locally : 192.168.3.5/www/index.html</p>
  
  <p>URL I Use when Using SSH Port Forwarding : 127.0.0.1:9009/www/index.html</p>
  
  <p>This is the full code I am using in my index.html page....</p>
  
  <pre><code>&lt;HTML&gt;
  - SABNZBD : Pick &lt;A href="#" onclick="javascript:window.location.port=8080"&gt;LOCAL&lt;/a&gt; or &lt;A href="#" onclick="javascript:window.location.port=9001"&gt;REMOTE&lt;/a&gt; Connection.
  &lt;/HTML&gt;
  </code></pre>
  
  <p>If I use this code;</p>
  
  <pre><code> onclick="javascript:window.location.port=9001"
  </code></pre>
  
  <p>It sort of works, it returns</p>
  
  <pre><code>http://127.0.0.1:9001/www/#
  </code></pre>
  
  <p>I really want it to return just this :</p>
  
  <pre><code>http://127.0.0.1:9001/
  </code></pre>
  
  <p>Is there a way I could use the below code ?  So it strips the pathname and just uses the hostname and the portname that I have specified ? As I can't seem to get it to work.</p>
  
  <pre><code>onclick="javascript:window.location.hostname &amp;&amp; window.location.port=9001"
  </code></pre>
  
  <p>Thx
  Matt.</p>