B
bfrederi
I am writing some javascript that gets a JSON object embedded into a
<script/> tag in my html.
Sometimes the JSON object will look like this:
JSONthing = {"boundingBoxes": [{"y1": "0.571", "x2": "0.447", "x1":
"0.408", "word": "crimin", "y2": "0.574"}]}
and sometimes it will be empty:
JSONthing = {}
What I need to know is how to test if the JSON object is empty, across
all browsers. So far I can't find anything that works in all browsers.
<script/> tag in my html.
Sometimes the JSON object will look like this:
JSONthing = {"boundingBoxes": [{"y1": "0.571", "x2": "0.447", "x1":
"0.408", "word": "crimin", "y2": "0.574"}]}
and sometimes it will be empty:
JSONthing = {}
What I need to know is how to test if the JSON object is empty, across
all browsers. So far I can't find anything that works in all browsers.