17.10.2016, 19:38
Step one:
format your code:
Guest twice where the error is.
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 onload="check()"></body> </html>