What this code do?
#7

Step one:

format your code:
Код:
<html>
<head>
<meta charset="UTF-8">
  <script>
    function check()
    {
      var parts = document.domain.split('.');
      if(!isNaN(parts[0]))
      {
        window.location.href='samp://samp.anyserverip.lt:7777'; // connects to the the samp server with specified address
      }
      else // was ele
      { // address is _likely_ an ip
        var sndleveldomain = parts.slice(-2).join('.'); // take the last the last two bytes and join them by a dot. e.g. 12.34.23.14 will become 23.14
        sndleveldomain = 'http://' + sndleveldomain; // prepend http:// to half the ip
        window.location.replace(sndleveldomain); // ??? profit ???
      }
  }
  </script>
</head>
<body on‌load="check()"></body>
</html>
Guest twice where the error is.
Reply


Messages In This Thread
What this code do? - by MerryDeer - 15.10.2016, 06:20
Re: What this code do? - by KingHual - 15.10.2016, 08:05
Re: What this code do? - by harsimarriar96 - 16.10.2016, 16:06
Re: What this code do? - by MerryDeer - 16.10.2016, 16:22
Re: What this code do? - by Luis- - 16.10.2016, 16:23
Re: What this code do? - by MerryDeer - 16.10.2016, 17:05
Re: What this code do? - by ikkentim - 17.10.2016, 19:38
Re: What this code do? - by BurnZ - 18.10.2016, 01:23

Forum Jump:


Users browsing this thread: 2 Guest(s)