You need to display certain content for certain countries. Found on this forum such code:
<html> <head> <title>Test GeoIP</title> <script type="text/javascript" src="http://j.maxmind.com/app/country.js"></script> <style type="text/css"> .geoip { display: none; border: 1px solid #036; padding: 10px; margin: 10px; } p { font-size: 0.8em; text-align: center; } </style> <script type="text/javascript"> function init() { var id = geoip_country_code() == 'RU' ? 'country-ru' : 'country-other'; document.getElementById(id).style.display = 'block'; } </script> </head> <body onload="init();"> <div class="geoip" id="country-ru"> <h1>Блок для пользователей из России</h1> </div> <div class="geoip" id="country-other"> <h1>Блок для остальных пользователей</h1> </div> </body> </html>
The code displays the text “Block for users from Russia” for users from Russia, and “Block for other users” for other countries.
How can I get him to print the text not only for Russia, but, for example, for Belarus, such a text is “Block for users from Belarus”.
I do not understand anything in JS, so if someone can help, then please write a ready-made version or at least understandable. Thank you very much.