Display Content Based on IP Address

Hi everyone! I’m currently interested in displaying a quick line or two of copy if a visiter’s IP address falls between a certain IP range. Do any of you have any resources or ideas of how I can go about it?

I’d like to use JS (maybe jQuery?) for this. I’d imagine I can use JS to detect the IP then use an IF statement to display said content. I’m pretty new to JS and is the reason why I would love some help from ya’ll :slight_smile:

Any help is MUCH appreciated. Thnx!

I was really hoping for some raw javascript or some jQuery. Don’t really want to rely on pre built stuff. I’m new to JS and would like to know if it’s even possible. Without server side scripting.

As always, much appreciated…

Nope, not really. You need to communicate with something in order to use geoIP. The geoIP data needs to be looked up somehow, and that can’t be done with just javascript. Javascript is a client-side language, only responsible for things that happen within the browser.




You’ll probably have to use a server side language with maxmind, then with JS, you can do an AJAX request. Same goes for hostip, since it would be from a different domain.