id4382
Jan 29th 2008, 5:51 pm
Ok,
What I am attempting to do is, create a script that will HIDE a paticular line of text on my webpage IF an IP address meets certain criteria. Now, the portion of the script that hides the text works IF the "IP" section is not in the code, once I input the "IP" section, the code will not work. I have pasted the whole code on the site. I think I am just wording it wrong. Please any help would be much much appreaciated!!!!!!
Code
<script type="text/javascript" language=Javascript">
<!--
var visitorIP = Request.ServerVariables("REMOTE_ADDR");
var list = document.getElementsByTagName("font");
If (var visitorIP == "63.197.120.142") Then {
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>
What I am attempting to do is, create a script that will HIDE a paticular line of text on my webpage IF an IP address meets certain criteria. Now, the portion of the script that hides the text works IF the "IP" section is not in the code, once I input the "IP" section, the code will not work. I have pasted the whole code on the site. I think I am just wording it wrong. Please any help would be much much appreaciated!!!!!!
Code
<script type="text/javascript" language=Javascript">
<!--
var visitorIP = Request.ServerVariables("REMOTE_ADDR");
var list = document.getElementsByTagName("font");
If (var visitorIP == "63.197.120.142") Then {
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>