I have a text box keeping the IP of the visitor.
I obtain IP in a text box ('ipaddr') of a form named 'myform' using the next script:
I would like to detect if the file is opened from local computer or from my domain trying to measure the length of the text in this text box. I must adapt the code because the company hosting the domain is adding a banner at top of tha page and I need to position some tags according to that... It works in FireFox but not in IE:
Length of the string is always 0 in IE...
Can you help on that issue ?
Thanks in advance!
Fane Duru
I obtain IP in a text box ('ipaddr') of a form named 'myform' using the next script:
Code:
var ip = '<!--#echo var="REMOTE_ADDR"-->'
function ipval() {
document.myform.ipaddr.value='Your IP: '+ip;
}
Code:
var sT =document.myform.ipaddr.value;
if (sT.length = 41){
alert('local')
//do something...
}else {
alert('hosted')
//do something else...
}
Can you help on that issue ?
Thanks in advance!
Fane Duru