Re: Javascript newbie - Please Help



StefanoElle wrote on 30 dec 2007 in comp.lang.javascript:

IF (user ip address) = = (ip address of www.mysite.com) THEN VAR
BaseURL = "192.168.1.5";
ELSE VAR BaseURL = "www.mysite.com:9000";

var BaseURL;
if (ip1 == ip2)
BaseURL = '192.168.1.5'
else
BaseURL = 'www.mysite.com:9000';

or:

var BaseURL = (ip1 == ip2) ? '192.168.1.5' : 'www.mysite.com:9000';

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
.



Relevant Pages

  • Re: Javascript newbie - Please Help
    ... BaseURL = 'www.mysite.com:9000'; ... How can I get ip1 and ip2? ... Remove the extra words to reply by e-mail. ...
    (comp.lang.javascript)
  • Re: Javascript newbie - Please Help
    ... StefanoElle wrote on 30 dec 2007 in comp.lang.javascript: ... BaseURL = 'www.mysite.com:9000'; ... How can I get ip1 and ip2? ...
    (comp.lang.javascript)
  • Re: Javascript newbie - Please Help
    ... if (ip1 == ip2) ... BaseURL = '192.168.1.5' ... ip address of the user and the ipaddress of www.mysite.com? ... Stefano ...
    (comp.lang.javascript)