Hi
I am getting a response from ajax request(done by jquery).
I have a method that displays errors to the users. Sometimes though I have some other information coming along with the json request.
So I don't want this info shown(where the rest of the errors are). So I figured since I always know the length of the json coming back I can just shorten the length since the error method just uses a while loop so if it is one less then it won't display that json part.
So I did this
var length = result.length -1;
ErrorsMethod(result, length); // call function.
function ErrorsMethod(result, length)
{
while( i < length)
{
// do stuff.
}
}
length is always undefined when it gets passed in though. I don't understand why.
I then tried
length.length ParseInt(length);
None seems to work. I don't even know what I am working with. When I do an alert of "length" var before it goes into the function it spits out a number.