title: How to execute some code based on ip address in javascript or jQuery?
body: <p>I am trying to make a premium version of my website and allowing only premium members to view some divs or hide ads, etc. I wanted to do it based on IP addresses. For that I searched the web and found this snippet:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;script type=&quot;text/javascript&quot; src=&quot;https://l2.io/ip.js?var=userip&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot;&gt;
  if (userip== 0.0.0.0 || 1.1.1.1) { // More addresses as required. Given addresses are for example only
  document. getElementsByClassName('ads-here'). style. display = &quot;none&quot;;
  }&lt;/script&gt;
  </code></pre>
  <p>But as always the above code doesn't work. I tried to do <code>document.write</code> and the output comes perfectly fine. What seems to be the problem here. Please explain.</p>
  <p>Note 1: I am still learning JavaScript.</p>
  <p>Note 2: The platform of my website is Blogger (Idk if that matters)</p>