I make this
var test = xmlhttpobject.responseText;
alert(test);
there is no problem with those two lines, the problem is that I'm sending from the server the word "si" and what I get in variable is a 5 characters word.
Then whe I'm trying to verify the word that I'm recieving with this
Expand|Select|Wrap|Line Numbers
- for( var i=0 ; i<test.length ; i++)
- {
- if ( test[i] == 's' )
- if ( test[i+1] == 'i' )
- test="si";
- }
if ( test == "si")
document.location.href = "url";
doesn't work and always get into the else statement of the if that didn't put it here.
When I'm verifiying the what the test variable containt with alert(test[i]) always say Undefined for all the characters even if the string has the letters "s" and "i"
The funny thing is that this work on Mozilla Firefox like with almost all the other things
Can someone help me with it?