Trying to make a simple 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.
Some info;
URL I use when accessing the webpage Locally : 192.168.3.5/www/index.html
URL I Use when Using SSH Port Forwarding : 127.0.0.1:9009/www/index.html
This is the full code I am using in my index.html page....
<HTML>
- SABNZBD : Pick <A href="#" onclick="javascript:window.location.port=8080">LOCAL</a> or <A href="#" onclick="javascript:window.location.port=9001">REMOTE</a> Connection.
</HTML>
If I use this code;
onclick="javascript:window.location.port=9001"
It sort of works, it returns
http://127.0.0.1:9001/www/#
I really want it to return just this :
http://127.0.0.1:9001/
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.
onclick="javascript:window.location.hostname && window.location.port=9001"
Thx Matt.