Here my current script to get updating value from JSON: jsFiddle
So after 20s, the page will reload 1 time to get the value from JSON. It was working fine if the JSON was generated within 20s but with >20s the chart can not be generated. I tried to use jQuery.isEmptyObject to verify if JSON empty and reload chart but no working. Am I missing or doing wrong somewhere.
This topic was modified 2 months, 2 weeks ago by jonasbui1476.
jQuery.isEmptyObject is used to check if the object is empty and doesn’t contain any properties. The JSON that you provided is actually an array of objects. So, you can check the length of an array to check if the JSON file that you obtained is empty or not.
Here is an updated jsFiddle for same.