Ok, so here is what i want to do, I will admit, I am a beginner at javascript so please go easy on me. I am wanting a javascript that will hide based off of what result is returned by another javascript. Here are the code snippets: GEOCity: Text Hide: The two codes seperately work fine right at this moment. What I want to be able to do, is set a restriction that the the 'Text Hide' code will only run IF a certain City is returned by the 'GEOCity' code. If anyone could help me on this I would be a great help!!!
<script type="text/javascript" language="Javascript"> if( geoip_city() == "Certain City"){ HideText(); } function HideText(){ var list = document.getElementsByTagName("font"); for (var i=0; i < list.length; i++) { if (list.innerHTML.indexOf("Members Price:") > -1) { list[i++].style.display="none"; if (list.innerHTML.indexOf("$") > -1) list.style.display="none"; } } } //--> </script>
Thanks Mnn, I pasted the code and have ran a few tests, and it is working great! To include additional cities, all I need is to add with a comma to seperate? Or is there an additional arrangement of code to tell it to watch for others?
to include additional cities: var city = geoip_city() ; if( city == "Certain City" || city == "Certain City2" || city == "Certain City3"){ HideText(); }