getJSON() expects json to be returned.
'No results' is a result in itself, so if you have no results, tell it you
have no results, maybe by returning {results:0} as opposed to {results:3,
data:{....}} or whatever.
At the very least return {}, an empty object, because that will at least
indicate that the called process was working as expected and didn't just
disappear!


shelane wrote:
> 
> 
> it seems that if no results are returned from a .$.getJSON, nothing in
> the function(results) callback function runs.  I just tested with a
> console.log('hello world') and got nothing.  if however valid JSON
> results are returned, everything works fine.
> 
> is this what it's supposed to do?  if so, how do I run a function if
> their are no results?
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/running-a-callback-function-even-when-no-results-returned-tf4159188s15494.html#a11840875
Sent from the JQuery mailing list archive at Nabble.com.

Reply via email to