I have an ajax call that currently returns the raw html that I am inserting into the page.
Now my problem is that in some situations I need to return the count value along with the raw html, and if this count is> 10, I need to run another jquery operation to make something visible.
A better approach here would be to return json then correctly? Therefore, I can do:
jsonReturned.counter
jsonReturned.html
Do you agree?
Also, out of curiosity more than anything, is json a more expensive quality? This is a simple object with properties, but just asking.
source
share