-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
The README says:
*Note If the ajax
property is true
and JSON Editor needs to fetch an external url, the api methods won't be available immediately.
Listen for the ready
event before calling them.
editor.on('ready',function() {
// Now the api methods will be available
editor.validate();
});
However, at least in Firefox, this pattern is also required regardless of whether ajax is true.
(This is because requestAnimationFrame
acts asynchronously to set self.validation_results
and validation_results
will not yet have been set if editor.validate()
is called immediately after the editor instantiation.)
I didn't know if you wanted the README to clarify this or if you want to avoid the asynchronicity for non-Ajax JSON validation.
Also, as an aside (and I'll start a new issue for it if you are open to it), it would be awesome if we could optionally support $ref
JSON references within normal JSON files in addition to use within JSON Schema: http://tools.ietf.org/id/draft-pbryan-zyp-json-ref-03.html