I am trying to run a javascript if statement on local variable that is set with a query response when the app is first started or when the user logs in. The javascript console is giving me an error stating that the variable is not defined. Not sure what needs to be done to fix this.
Thanks!! But the big issue was trying to put the response into a local array variable.
Thanks Max! Just an FYI checking if it was blank by just doing "" didn't work. I had to check if the response text was "[]" for it to work. Evidently the square brackets are part of the text response.
is (response is empty) an actual condition that can be tested or is there another way to get the response from the server? the service is called get_friend, how do I get the response so I can test if it is empty?
I am still not figuring this out on how to validate if the response if empty.
How would I write this code to check for an empty response?
What would the javascript be to check a response?
That is exactly what is happening. It returns a success but the response is blank. I'm not sure what to do now. I only want the second service to be invoked if the username that is searched for actually exists.