The flask backend passes the value to the front-end javascript and passes a null, such as ['Global',null,0,0]. If you use str to pass it, it will be ['Global','null',0,0], yes What can I do?
習慣沉默2017-06-22 11:53:24
In the standard JSON format, the null
value is included.
Python’s JSON library can parse null
values normally.
https://docs.python.org/3/lib...
>>> import json
>>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])
'["foo", {"bar": ["baz", null, 1.0, 2]}]'
will parse None
to null
.
And the front-end’s JSON.pars
e can handle null
values normally.