id4382
Jan 31st 2008, 10:08 am
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:
<script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
<script language="JavaScript">document.write(geoip_city());</script>
Text Hide:
<script type="text/javascript" language="Javascript">
var list = document.getElementsByTagName("font");
for (var i=0; i < list.length; i++) {
if (list[i].innerHTML.indexOf("Members Price:") > -1) {
list[i++].style.display="none";
if (list[i].innerHTML.indexOf("$") > -1) list[i].style.display="none";
}
}
//-->
</script>
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!!!
GEOCity:
<script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
<script language="JavaScript">document.write(geoip_city());</script>
Text Hide:
<script type="text/javascript" language="Javascript">
var list = document.getElementsByTagName("font");
for (var i=0; i < list.length; i++) {
if (list[i].innerHTML.indexOf("Members Price:") > -1) {
list[i++].style.display="none";
if (list[i].innerHTML.indexOf("$") > -1) list[i].style.display="none";
}
}
//-->
</script>
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!!!