I'm in the process of streamlining my website, and want to display elements on the site specific to my ip address that the public cannot see. I have a static IP address, which is half the battle.
After an intense google session, I have found a snippet of code that pulls my IP and throws an alert. if feel this is the closest to my goal, but unsure how I can adapt it. For example, if IP address is 'this' show div, if not hide div.
// Find IP, throws alert
$.getJSON("http://jsonip.com?callback=?", function (data) {
alert(data.ip);
});
// My Attempt - Hide menu if IP matches
var data = '00.00.00.000';
$('#Menu').each(function() {
if (this.data == '00.00.00.000') {
$(this).addClass('hide-me');
}
Any advise or suggestions would be a massive help.
Thanks, Ant