I am returning a string from an ajax call. I want to test if any records were returned. If the server side app does not return any records I load the return string with this code
I test for the NoRecord message like this
It always evaluates to the no records found condition even when records are returned. I have also tried the reverse where I still got the same result.
Code:
responseText = {"NoRecord":"No records found"}
Code:
aString = returnedString.split(";;");
//test if any records were found
if ( aString.indexOf( 'NoRecord":"No records found' ) != -1 )
{
....process returned records.....
}else{
...display no records returned message...
}
Code:
aString = returnedString.split(";;");
//test if any records were found
if ( aString.indexOf( 'NoRecord":"No records found' ) == -1 )
{
...display no records returned message...
}else{
....process returned records.....
}
Comment