Forum Moderators: martinibuster
So if a visitor from a less attractive (including my own, that's how I noticed) country visits the page, he sees a text: "I've seen a cool site that offers, you should check it out" since the text link isn't displayed.
How can I resolve this issue? I could display nothing or something else in this place based on visitor's IP, but how do I check which countries are filtered out? If you have any idea, please reply.
Put the ad in a <DIV> element and all of the text, including the ad in another <DIV>. Let's say the ad's DIV id is "AdDiv" and the text DIV id is "TextDiv." You could check to see if AdDiv exists using getElementById and InnerHTML.length.
For example:
<DIV id='TextDiv'>I've seen a cool site that offers <DIV id='AdDiv'>{{great-widget-code}}</DIV>, you should check it out.</DIV>
<script type="text/javascript">
if (document.getElementById("AdDiv").innerHTML.length == 0)
{
document.getElementById("TextDiv").innerHTML = "some other ad code";
}
</script>
I'm not sure if this will work because I haven't tried it :) But this is where I would start.